Note: : FFMPEG-Java and jffmpeg are not the same thing. FFmpeg-Java is a sub-project of freedom for media in Java (FMJ.
This project follows the lgpl license. It has an optional GPL component to use the ffmpeg gpl swscale library. If you want to use swscale and GPL, you can use a ffmpeg-java-gpl.jar. The standard lgpl jar for this project is ffmpeg-java.jar.
FFmpeg-Java is an encapsulation of FFMPEG using JNA. It assumes that the dynamic library about FFMPEG has been compiled and placed in your library path.
Note: : Disable MMX in this example because it has caused many problems.
Step 1 : Get FFMPEG source code
Http://ffmpeg.mplayerhq.hu
Step 2 : Build/install FFMPEG
./Configure -- disable-MMX -- enable-shared
Make
Sudo make install
Step 3 : Use a multimedia file as the first parameter. Running example Program .
In some * nix systems, you must specify your library path. For example:
Export LD_LIBRARY_PATH =/usr/local/lib
Playback example
Play a video in a window:
Java-CP./ffmpeg-java.jar:./lib/JNA. Jar net. SF. ffmpeg_java.example.playerexample http://www.javasaver.com/testjs/jmf/anim/2005-11-26.mov
Video Codec example
Use the first five frames of the video to create a 5 ppm file in the current directory:
Java-CP./ffmpeg-java.jar:./lib/JNA. Jar net. SF. ffmpeg_java.example.avcodecsample http://www.javasaver.com/testjs/jmf/anim/2005-11-26.mov
Good documentation on setting the compilation environment-msys and mingw-and how to build FFMPEG on Windows
Here (if it cannot be opened, go over the wall. FFmpeg can also be provided, but some information about image codec/format (content) is lost.
Original article:
Http://fmj-sf.net/ffmpeg-java/getting_started.php.