Aside from deploying JMF, is there an easier and slimmer way to generate movie files from Java?
Well you can always grab the frame/pixel buffer and use ImageIO or whatever to save lots of frames, then encode with mplayer or something.
Or do you mean playback? in which case i would recommend Rivens player that uses pipes and external code.
Riven posted some good info on making animated gifs. I don’t know how different it would be to make .mov files.
If you just want to record, you can just take any software, I’m not sure what you mean.
Developing your own screen capture software in java ?
I mean have the Java program directly save a video to an AVI file for instance.
One does not simply “save as a AVI”. You have to encode it with a codec then pack it into a container. AVI is a container that could have content encoded from a number of different codecs.
So the short answer is no you can’t do that with a few simple calls in java. However in most OS there are tools available that can take a stack of images and encode and pack them for you. mencoder or mplayer for example. Or VLC. Java never really sorted out any properly standard lib support for it.
GStreamer can do this, but you’ll have to get down and dirty with pipeline configuration - https://github.com/gstreamer-java. There are some Processing examples for recording AVI using GStreamer 0.10 - I’m not sure if the GStreamer 1.x bindings will work for this yet (and if not it’s my issue to fix it :persecutioncomplex: )
One project that might be worth looking at is https://github.com/sarxos/webcam-capture It’ll give you some idea of various video libraries that are available, and it does have an example for recording to file (not tried it!)
I’ve also seen code that claims to write an MJPEG AVI in pure Java - check out the AVIWriter class on this page - http://www.randelshofer.ch/monte/
GStreamer is absolutely horrible. Just use mencoder or VLC and be done i 5 min instead of having nothing but problems for days.
GStreamer has a learning curve! Encoding a sequence of images is not always the best option for this, though - depends what the OP wants to do. Mind you, another option coming from what you said - VLCJ probably allows you to feed a pipeline directly with image data too (https://github.com/caprica/vlcj)
btw, while you’re right that Java has never developed a proper standard lib for writing video files, you know that the new standard lib for playing them is based on GStreamer, right? :persecutioncomplex:
Why not use ffmpeg or libav?
Why? What for? D:
I hate to be that guy, that asks for why, but unless you are developing stuff that nsigma does, or like a screencapture proram, video converter or video editing software… why would you need that?
Good question! In fact, I haven’t implemented video rendering to file in my stuff so far either - the reason, because if you have the stuff on screen, and particularly if it’s OpenGL / accelerated rendering, you’ll likely get better performance from a screen capture software designed for gaming than you will from something internal (without a lot of work).