tags:

views:

2837

answers:

5

I'm pretty new to Java, need to write a program that listen to video conversion instructions and convert the video once an new instruction arrives (instructions is stored in Amazon SQS, but it's irrelevant to my question)

I'm facing a choice, either use Java RunTime to exec 'ffmpeg' conversion (like from command line), or I can use a ffmpeg wrapper written inJava http://fmj-sf.net/ffmpeg-java/getting%5Fstarted.php

I'd much prefer using Java Runtime to exec ffmpeg directly, and avoid using java-ffmpeg wrapper as I have to learn the library. so my question is are there any benefits using java-ffmpeg wrapper over exec ffmpeg directly using Runtime? I don't need ffmpeg to play videos, just convert videos

Thanks

A: 

The benefits of using the wrapper would be mainly that it offers more and fine-grained functionality not accessible via the command line (not relevant to you) and makes error handling and status control easier - you'll have to parse the command line tool's standard output and error streams.

Michael Borgwardt
thanks for the info
+2  A: 

If I'm not mistaken, the "ffmpeg wrapper" project you linked to is out of date and not maintained. ffmpeg is a very active project, lot's of changes and releases all the time.

You should look at the Xuggler project, this provides a Java API for what you want to do, and they have tight integration with ffmpeg.

http://www.xuggle.com/xuggler/

Should you choose to go down the Runtime.exec() path, this Red5 thread should be useful:

http://www.nabble.com/java-call-ffmpeg-ts15886850.html

Peter Thomas
Thanks for the info, I'll digg into xuggler, sounds interesting
just took a brief look at xuggler documentation, exactly what I need. thanks for helping!
Great. Just be aware that it is GPL, you may need a commercial license in production.
Peter Thomas
right, will look into that as well
Actually Xuggler is now LGPL (although it will be GPL if you use it with libx264)
Xuggle
A: 

Also, as of Xuggler 3.3, Xuggler is LGPL meaning you don't need a commercial license.

Xuggle
A: 

you can try jave http://www.sauronsoftware.it/projects/jave

sohilv
A: 

You can use a simple FFmpeg wrapper java library which is lightweight and comes with all of the cross-platform ffmpeg executables pre-built.

Its under the Apache Licence 2.0 and is here: http://ivolo.mit.edu/post/Metamorph-Convert-Audio-Video-to-Any-Format-on-Windows-Linux-and-Mac.aspx

Ilya