tags:

views:

152

answers:

3

I'm writing a Java program that will be used on both Windows and Mac. In the program, I'm using FFMPEG to convert a MOV file to an FLV. On Windows, it's no problem -- simply call the command. But on Mac, I'm not quite sure what to do. Does the user really have to install FFMPEG on their machine, or can it somehow be included in the Java application?

Thanks for any help/guidance!

+1  A: 

Haven't played with it yet, but isn't FFMPEG availabe as a library? Then you could simply call it via JNI or better JNA. This should work on both platforms.

Axel
Thanks Axel. I'm not too familiar with how the whole process works, but I know that I had to do a make and install to get it set up on my Mac. Would my users have to do the same thing, or is there a file I can just include in my package so that the library is set up and ready to go?
James Skidmore
Oh, now I see. FFMPEG as just distributed in source. I don't have a mac, but since MacOS X is based on Unix, perhaps I can help anyway.Provided there are no licensing issues, you could distribute the binary (and required libraries if any, use 'nm' to find out) you have compiled together with your application.The alternative would be to use libavformat/libavcodec instead of starting FFMPEG via cli. I'd recommend using JNA as it seems much simpler than writing JNI wrapper.
Axel
+1  A: 

If you are using the Java Media Framework (JMF), Fobs4JMF is a Java wrapper for FFMPEG that works as a JMF plugin.

Iggy Kay
+1  A: 

You could also check out Xuggler, a Java wrapper for FFmpeg that works on Windows, Mac and Linux.

Xuggle