FFmpeg-Java getting started

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.