<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>JAVE manual</title>
<style type="text/css">
table {
  border: 1px solid black;
  border-collapse: collapse;
}
table tr th {
  border: 1px solid black;
  padding: 3px;
}
table tr td {
  border: 1px solid black;
  padding: 3px;
}
</style>
</head>
<body>
 <h1>JAVE manual</h1>
 <ul>
   <li><a href="#1">Installation and requirements</a></li>
   <li><a href="#2">Audio/video encoding</a></li>
   <li><a href="#3">Encoding attributes</a></li>
   <ul>
     <li><a href="#3.1">Audio encoding attributes</a></li>
	 <li><a href="#3.2">Video encoding attributes</a></li>
   </ul>
   <li><a href="#4">Monitoring the transcoding operation</a></li>
   <li><a href="#5">Transcoding failures</a></li>
   <li><a href="#6">Getting informations about a multimedia file </a></li>
   <li><a href="#7">Using an alternative ffmpeg executable</a></li>
   <li><a href="#8">Supported container formats</a></li>
   <li><a href="#9">Built-in decoders and encoders</a></li>
   <li><a href="#10">Examples</a></li>
 </ul>
 <a name="1"></a>
 <h1>Installation and requirements</h1>
 <p>In order to use JAVE in your Java application, you have to add the file <em>jave-1.0.jar</em> in your application CLASSPATH.</p>
 <p>JAVE runs on a Java Runtime Environment J2SE v.1.4 or later.</p>
 <p>JAVE includes and uses a <em>ffmpeg</em> executable built for Windows and Linux operating systems on i386/32 bit hardware platforms. In order to run JAVE on other platforms you have to replace the built-in ffmpeg executable with another one suitable for your needs. This is very simple, once you have built your own ffmpeg binaries. The operation is described in the &quot;<a href="#7">Using an alternative ffmpeg executable</a>&quot; section.</p>
 <a name="2"></a>
 <h1>Audio/video encoding</h1>
 <p>The most important JAVE class is <em>it.sauronsoftware.jave.Encoder</em>. <em>Encoder</em> objects expose many methods for multimedia transcoding. In order to use JAVE, you always have to create an <em>Encoder</em> istance:</p>
 <pre>Encoder encoder = new Encoder();</pre>
 <p>Once the instance has been created, you can start transcoding calling the <em>encode()</em> method:</p>
 <pre>public void <strong>encode</strong>(java.io.File&nbsp;source,
                   java.io.File&nbsp;target,
                   it.sauronsoftware.jave.EncodingAttributes&nbsp;attributes)
            throws java.lang.IllegalArgumentException,
                   it.sauronsoftware.jave.InputFormatException,
                   it.sauronsoftware.jave.EncoderException</pre>
 <p>The first parameter, <em>source</em>, represents the source file to decode.</p>
 <p>The second parameter, <em>target</em>, is the target file that will be created and encoded.</p>
 <p>The <em>attributes</em> parameter, whose type is <em>it.sauronsoftware.jave.EncodingAttributes</em>, is a data structure containing any information needed by the encoder.</p>
 <p>Please note that a call to <em>encode()</em> is a blocking one: the method will return only once the transcoding operation has been completed (or  failed). If you are interested in monitoring the transcoding operation take a look to the &quot;<a href="#4">Monitoring the transcoding operation</a>&quot; section.</p>
 <a name="3"></a>
 <h1>Encoding attributes</h1>
 <p>To specify your preferences about the transcoding operation you have to supply an <em>it.sauronsoftware.jave.EncodingAttributes</em> instance to the <em>encode()</em> call. You can create your own <em>EncodingAttributes</em> instance, and you can populate it with the following methods:</p>
 <ul>
   <li><code>public void <strong>setAudioAttributes</strong>(it.sauronsoftware.jave.AudioAttributes audioAttributes)</code><br />
     It sets the audio encoding attributes. If never called on a new <em>EncodingAttributes</em> instance, or if the given parameter is <em>null</em>, no audio stream will be included in the encoded file. See also &quot;<a href="#3.1">Audio encoding attributes</a>&quot;.</li>
   <li><code>public void <strong>setVideoAttributes</strong>(it.sauronsoftware.jave.AudioAttributes videoAttributes)</code><br />
     It sets the video encoding attributes. If never called on a new <em>EncodingAttributes</em> instance, or if the given parameter is <em>null</em>, no video stream will be included in the encoded file. See also &quot;<a href="#3.2">Video encoding attributes</a>&quot;.</li>
   <li><code>public void <strong>setFormat</strong>(java.lang.String formatHandle)</code><br />
     It sets the formatHandle of the streams container that will be used for the new encoded file. The given parameter represents the formatHandle name. An encoding formatHandle name is valid and supported only if it appears  in the list returned by the <em>getSupportedEncodingFormats()</em> method of the <em>Encoder</em> instance in use.</li>
   <li><code>public void <strong>setOffset</strong>(java.lang.Float offset)</code><br />
     It sets an offset for the transcoding operation. The source file will be re-encoded starting at <em>offset</em> seconds since its beginning. In example if you'd like to cut the first five seconds of the source file, you should call <em>setOffset(5)</em> on the <em>EncodingAttributes</em> object passed to the encoder.</li>
   <li><code>public void <strong>setDuration</strong>(java.lang.Float duration)</code><br />
     It sets a duration for the transcoding operation. Only <em>duration</em> seconds of the source will be re-encoded in the target file. In example if you'd like to extract and transcode a portion of thirty seconds from the source, you should call <em>setDuration(30)</em> on the <em>EncodingAttributes</em> object passed to the encoder.</li>
 </ul>
 <a name="3.1"></a>
 <h2>Audio encoding attributes</h2>
 <p>Audio encoding attributes are represented by the instances of the <em>it.sauronsoftware.jave.AudioAttributes</em> class. The available methods on this kind of objects are:</p>
 <ul>
   <li><code>public void <strong>setCodec</strong>(java.lang.String codec)</code><br />
     It sets the name of the codec that will be used for the transcoding of the audio stream. You have to choose a value from the list returned by the <em>getAudioEncoders() </em>method of the current <em>Encoder</em> instance. Otherwise you can pass the <em>AudioAttributes.DIRECT_STREAM_COPY</em> special value, that requires the copy of the original  audio stream from the source file.</li>
   <li><code>public void <strong>setBitRate</strong>(java.lang.Integer bitRate)</code><br />
     It sets the bitrate value for the new re-encoded audio stream. If no bitrate value is set, a default one will be picked by the encoder. The value should be expressed in bits per second. In example if you want a 128 kb/s bitrate you should call <em>setBitRate(new Integer(128000))</em>.</li>
   <li><code>public void <strong>setSamplingRate</strong>(java.lang.Integer bitRate)</code><br />
     It sets the sampling rate for the new re-encoded audio stream. If no sampling-rate value is set, a default one will be picked by the encoder. The value should be expressed in hertz. In example if you want a CD-like 44100 Hz sampling-rate, you should call <em>setSamplingRate(new Integer(44100))</em>.</li>
   <li><code>public void <strong>setChannels</strong>(java.lang.Integer channels)</code><br />
     It sets the number of the audio channels that will be used in the re-encoded audio stream (1 = mono, 2 = stereo). If no channels value is set, a default one will be picked by the encoder.</li>
   <li><code>public void <strong>setVolume</strong>(java.lang.Integer volume)</code><br />
     This method can be called to alter the volume of the audio stream. A value of 256 means no volume change. So a value less than 256 is a volume decrease, while a value greater than 256 will increase the volume of the audio stream.</li>
 </ul>
 <a name="3.2"></a>
 <h2>Video encoding attributes</h2>
 <p>Video encoding attributes are represented by the instances of the <em>it.sauronsoftware.jave.VideoAttributes</em> class. The available methods on this kind of objects are:</p>
 <ul>
   <li><code>public void <strong>setCodec</strong>(java.lang.String codec)</code><br />
     It sets the name of the codec that will be used for the transcoding of the video stream. You have to choose a value from the list returned by the <em>getVideoEncoders() </em>method of the current <em>Encoder</em> instance. Otherwise you can pass the <em>VideoAttributes.DIRECT_STREAM_COPY</em> special value, that requires the copy of the original video stream from the source file.</li>
   <li><code>public void <strong>setTag</strong>(java.lang.String tag)</code><br />
     It sets the tag/fourcc value associated to the re-encoded video stream. If no value is set a default one will be picked by the encoder. The tag value is often used by multimedia players to choose which video decoder run on the stream. In example a MPEG 4 video stream with a &quot;DIVX&quot; tag value will be decoded with the default DivX decoder used by the player. And, by the way, this is exactly what a DivX is: a MPEG 4 video stream with an attached &quot;DIVX&quot; tag/fourcc value!</li>
   <li><code>public void <strong>setBitRate</strong>(java.lang.Integer bitRate)</code><br />
     It sets the bitrate value for the new re-encoded video stream. If no bitrate value is set, a default one will be picked by the encoder. The value should be expressed in bits per second. In example if you want a 360 kb/s bitrate you should call <em>setBitRate(new Integer(360000))</em>.</li>
   <li><code>public void <strong>setFrameRate</strong>(java.lang.Integer bitRate)</code><br />
     It sets the frame rate value for the new re-encoded audio stream. If no bitrate frame-rate is set, a default one will be picked by the encoder. The value should be expressed in frames per second. In example if you want a 30 f/s frame-rate you should call <em>setFrameRate(new Integer(30))</em>.</li>
   <li><code>public void <strong>setSize</strong>(it.sauronsoftware.jave.VideoSize size)</code><br />
     It sets the size and the proportion of the images in the video stream. If no value is set, the encoder will preserve the original size and proportion. Otherwise you can pass a  <em>it.sauronsoftware.java.VideoSize</em> instance, with your preferred size. You can set the width and the height of the new encoded video, with pixel values, scaling the original one. In example if you want to scale the video to 512 px in width and 384px in height you should call <em>setSize(new VideoSize(512, 384))</em>.</li>
 </ul>
 <a name="4"></a>
 <h1>Monitoring the transcoding operation</h1>
 <p>You can monitor a transcoding operation with a listener. JAVE defines the  <em>it.sauronsoftware.jave.EncoderProgressListener</em> interface. This interface could be implemented by your application, and concrete <em>EncoderProgressListener</em> instances can be passed to the encoder. The encoder will call your listener methods every time a significant event occurs. To pass an <em>EncoderProgressListener</em> to the encoder you should use this definition of the <em>encode()</em> method:</p>
 <pre>public void <strong>encode</strong>(java.io.File&nbsp;source,
                   java.io.File&nbsp;target,
                   it.sauronsoftware.jave.EncodingAttributes&nbsp;attributes,
                   <strong>it.sauronsoftware.jave.EncoderProgressListener listener</strong>)
            throws java.lang.IllegalArgumentException,
                   it.sauronsoftware.jave.InputFormatException,
                   it.sauronsoftware.jave.EncoderException</pre>
 <p>To implemen the <em>EncoderProgressListener</em> interface you have to define all of the following methods:</p>
 <ul>
   <li><code>public void <strong>sourceInfo</strong>(it.sauronsoftware.jave.MultimediaInfo info)</code><br />
     The encoder calls this method after the source file has been analized. The <em>info</em> parameter is an instance of the  <em>it.sauronsoftware.jave.MultimediaInfo</em> class and it represents informations about the source audio and video streams and their container.</li>
   <li><code>public void <strong>progress</strong>(int permil)</code><br />
     This method is called by the encoder every time a progress in the encoding operation has been done. The <em>permil</em> parameter is a value representing the point reached by the current operation and its range is from 0 (operation just started) to 1000 (operation completed).</li>
   <li><code>public void <strong>message</strong>(java.lang.String message)</code><br />
     This method is called by the encoder to notify a message regarding the transcoding operation (usually the message is a warning).</li>
 </ul>
 <a name="5"></a>
 <h1>Transcoding failures</h1>
 <p>Of course, a transcoding operation could fail. Then the <em>encode()</em> method will propagate an exception. Depending on what is happened, the exception will be one of the following:</p>
 <ul>
   <li><em>java.lang.IllegalArgumentException</em><br />
     The transcoding operation has never started since the encoding attributes passed to the encoder has been recognized as invalid. Usualy this occurs when the EncodingAttributes instance given to the encoder asks the encoding of a container with no audio and no video streams (both <em>AudioAttributes</em> and <em>VideoAttribues</em> attributes are <em>null</em> or not set).</li>
   <li><em>it.sauronsoftware.jave.InputFormatException</em><br />
     The source file can't be decoded. It occurs when the source file container, the video stream formatHandle or the audio stream formatHandle are not supported by the decoder. You can check for supported containers and plugged decoders calling the encoder methods <em>getSupportedDecodingFormats()</em>, <em>getAudioDecoders()</em> and <em>getVideoDecoders()</em>.
   </li>
   <li><em>it.sauronsoftware.jave.EncoderExpection</em><br />
     The operation has failed during the trancoding due to an internal error. You should check the exception message, and you can also use an <a href="#4"><em>EncoderProgressListener</em></a> instance to check any message issued by the encoder.</li>
 </ul>
 <a name="6"></a>
 <h1>Getting informations about a multimedia file </h1>
 <p>You can get informations about an existing multimedia file before transcoding it, calling the encoder <em>getInfo()</em> method. The <em>getInfo()</em> method gives you informations about the container used by the file and about its wrapped audio and video streams:</p>
 <pre>public it.sauronsoftware.jave.MultimediaInfo <strong>getInfo</strong>(java.io.File&nbsp;source)
                                             throws it.sauronsoftware.jave.InputFormatException,
                                                    it.sauronsoftware.jave.EncoderException</pre>
 <p>An <em>it.sauronsoftware.jave.MultimediaInfo</em> object encapsulates information on the whole multimedia content and its streams, using  instances of <em>it.sauronsoftware.jave.AudioInfo</em> and <em>it.sauronsoftware.jave.VideoInfo</em> to describe the wrapped audio and video. These objects are similar to the  <em><a href="#3">EncodingAttributes</a></em>, <em><a href="#3.1">AudioAttributes</a></em> and <em><a href="#3.2">VideoAttributes</a></em> ones, but they works in a read-only mode. Check the JAVE API javadoc documentation, bundled with the JAVE distribution, to gain more details about them.</p>
 <a name="7"></a>
 <h1>Using an alternative ffmpeg executable</h1>
 <p>JAVE is not pure Java: it acts as a wrapper around an <em>ffmpeg</em> (<a href="http://ffmpeg.mplayerhq.hu/">http://ffmpeg.mplayerhq.hu/</a>) executable. ffmpeg is an open source and free software project entirely written in C, so its executables cannot be easily ported from a machine to another. You need a pre-compiled version of  ffmpeg  in order to run JAVE on your target machine. The JAVE distribution includes two pre-compiled executables of ffmpeg: a Windows one and a Linux one, both compiled for i386/32 bit hardware achitectures. This should be enough in most cases. If it is not enough for your specific situation, you can still run JAVE, but you need to obtain a platform specific ffmpeg executable. Check the Internet for it. You can even build it by yourself getting the code (and the documentation to build it) on the official ffmpeg site. Once you have obtained a ffmpeg executable suitable for your needs, you have to hook it in the JAVE library. That's a plain operation. JAVE gives you an abstract class called <em>it.sauronsoftware.jave.FFMPEGLocator</em>. Extend it. All you have to do is to define the following method:</p>
 <pre>public java.lang.String <strong>getFFMPEGExecutablePath</strong>()</pre>
 <p>This method should return a file system based path to your custom ffmpeg executable.</p>
 <p>Once your class is ready, suppose you have called it <em>MyFFMPEGExecutableLocator</em>, you have to create an alternate encoder that uses it instead of the default locator:</p>
 <pre>Encoder encoder = new Encoder(new MyFFMPEGExecutableLocator())</pre>
 <p>You can use the same procedure also to switch to other versions of ffmpeg, even if you are on a platform covered by the executables bundled in the JAVE distribution.</p>
 <p>Anyway be careful and test ever your application: JAVE it's not guaranteed to work properly with custom ffmpeg executables different from the bundled ones.</p>
 <a name="8"></a>
 <h1>Supported container formats</h1>
 <p>The JAVE built-in ffmpeg executable gives support for the following multimedia container formats:</p>
 <h2>Decoding</h2>
 <table>
 	<tr><th>Formato</th><th>Descrizione</th></tr>
 	<tr><td>4xm</td><td>4X Technologies formatHandle</td></tr>
 	<tr><td>MTV</td><td>MTV formatHandle</td></tr>
 	<tr><td>RoQ</td><td>Id RoQ formatHandle</td></tr>
 	<tr><td>aac</td><td>ADTS AAC</td></tr>
 	<tr><td>ac3</td><td>raw ac3</td></tr>
 	<tr><td>aiff</td><td>Audio IFF</td></tr>
 	<tr><td>alaw</td><td>pcm A law formatHandle</td></tr>
 	<tr><td>amr</td><td>3gpp amr file formatHandle</td></tr>
 	<tr><td>apc</td><td>CRYO APC formatHandle</td></tr>
 	<tr><td>ape</td><td>Monkey's Audio</td></tr>
 	<tr><td>asf</td><td>asf formatHandle</td></tr>
 	<tr><td>au</td><td>SUN AU Format</td></tr>
 	<tr><td>avi</td><td>avi formatHandle</td></tr>
 	<tr><td>avs</td><td>AVISynth</td></tr>
 	<tr><td>bethsoftvid</td><td>Bethesda Softworks 'Daggerfall' VID formatHandle</td></tr>
 	<tr><td>c93</td><td>Interplay C93</td></tr>
 	<tr><td>daud</td><td>D-Cinema audio formatHandle</td></tr>
 	<tr><td>dsicin</td><td>Delphine Software International CIN formatHandle</td></tr>
 	<tr><td>dts</td><td>raw dts</td></tr>
 	<tr><td>dv</td><td>DV video formatHandle</td></tr>
 	<tr><td>dxa</td><td>dxa</td></tr>
 	<tr><td>ea</td><td>Electronic Arts Multimedia Format</td></tr>
 	<tr><td>ea_cdata</td><td>Electronic Arts cdata</td></tr>
 	<tr><td>ffm</td><td>ffm formatHandle</td></tr>
 	<tr><td>film_cpk</td><td>Sega FILM/CPK formatHandle</td></tr>
 	<tr><td>flac</td><td>raw flac</td></tr>
 	<tr><td>flic</td><td>FLI/FLC/FLX animation formatHandle</td></tr>
 	<tr><td>flv</td><td>flv formatHandle</td></tr>
 	<tr><td>gif</td><td>GIF Animation</td></tr>
 	<tr><td>gxf</td><td>GXF formatHandle</td></tr>
 	<tr><td>h261</td><td>raw h261</td></tr>
 	<tr><td>h263</td><td>raw h263</td></tr>
 	<tr><td>h264</td><td>raw H264 video formatHandle</td></tr>
 	<tr><td>idcin</td><td>Id CIN formatHandle</td></tr>
 	<tr><td>image2</td><td>image2 sequence</td></tr>
 	<tr><td>image2pipe</td><td>piped image2 sequence</td></tr>
 	<tr><td>ingenient</td><td>Ingenient MJPEG</td></tr>
 	<tr><td>ipmovie</td><td>Interplay MVE formatHandle</td></tr>
 	<tr><td>libnut</td><td>nut formatHandle</td></tr>
 	<tr><td>m4v</td><td>raw MPEG4 video formatHandle</td></tr>
 	<tr><td>matroska</td><td>Matroska File Format</td></tr>
 	<tr><td>mjpeg</td><td>MJPEG video</td></tr>
 	<tr><td>mm</td><td>American Laser Games MM formatHandle</td></tr>
 	<tr><td>mmf</td><td>mmf formatHandle</td></tr>
 	<tr><td>mov,mp4,m4a,3gp,3g2,mj2</td><td>QuickTime/MPEG4/Motion JPEG 2000 formatHandle</td></tr>
 	<tr><td>mp3</td><td>MPEG audio layer 3</td></tr>
 	<tr><td>mpc</td><td>musepack</td></tr>
 	<tr><td>mpc8</td><td>musepack8</td></tr>
 	<tr><td>mpeg</td><td>MPEG1 System formatHandle</td></tr>
 	<tr><td>mpegts</td><td>MPEG2 transport stream formatHandle</td></tr>
 	<tr><td>mpegtsraw</td><td>MPEG2 raw transport stream formatHandle</td></tr>
 	<tr><td>mpegvideo</td><td>MPEG video</td></tr>
 	<tr><td>mulaw</td><td>pcm mu law formatHandle</td></tr>
 	<tr><td>mxf</td><td>MXF formatHandle</td></tr>
 	<tr><td>nsv</td><td>NullSoft Video formatHandle</td></tr>
 	<tr><td>nut</td><td>nut formatHandle</td></tr>
 	<tr><td>nuv</td><td>NuppelVideo formatHandle</td></tr>
 	<tr><td>ogg</td><td>Ogg formatHandle</td></tr>
 	<tr><td>psxstr</td><td>Sony Playstation STR formatHandle</td></tr>
 	<tr><td>rawvideo</td><td>raw video formatHandle</td></tr>
 	<tr><td>redir</td><td>Redirector formatHandle</td></tr>
 	<tr><td>rm</td><td>rm formatHandle</td></tr>
 	<tr><td>rtsp</td><td>RTSP input formatHandle</td></tr>
 	<tr><td>s16be</td><td>pcm signed 16 bit big endian formatHandle</td></tr>
 	<tr><td>s16le</td><td>pcm signed 16 bit little endian formatHandle</td></tr>
 	<tr><td>s8</td><td>pcm signed 8 bit formatHandle</td></tr>
 	<tr><td>sdp</td><td>SDP</td></tr>
 	<tr><td>shn</td><td>raw shorten</td></tr>
 	<tr><td>siff</td><td>Beam Software SIFF</td></tr>
 	<tr><td>smk</td><td>Smacker Video</td></tr>
 	<tr><td>sol</td><td>Sierra SOL Format</td></tr>
 	<tr><td>swf</td><td>Flash formatHandle</td></tr>
 	<tr><td>thp</td><td>THP</td></tr>
 	<tr><td>tiertexseq</td><td>Tiertex Limited SEQ formatHandle</td></tr>
 	<tr><td>tta</td><td>true-audio</td></tr>
 	<tr><td>txd</td><td>txd formatHandle</td></tr>
 	<tr><td>u16be</td><td>pcm unsigned 16 bit big endian formatHandle</td></tr>
 	<tr><td>u16le</td><td>pcm unsigned 16 bit little endian formatHandle</td></tr>
 	<tr><td>u8</td><td>pcm unsigned 8 bit formatHandle</td></tr>
 	<tr><td>vc1</td><td>raw vc1</td></tr>
 	<tr><td>vmd</td><td>Sierra VMD formatHandle</td></tr>
 	<tr><td>voc</td><td>Creative Voice File formatHandle</td></tr>
 	<tr><td>wav</td><td>wav formatHandle</td></tr>
 	<tr><td>wc3movie</td><td>Wing Commander III movie formatHandle</td></tr>
 	<tr><td>wsaud</td><td>Westwood Studios audio formatHandle</td></tr>
 	<tr><td>wsvqa</td><td>Westwood Studios VQA formatHandle</td></tr>
 	<tr><td>wv</td><td>WavPack</td></tr>
 	<tr><td>yuv4mpegpipe</td><td>YUV4MPEG pipe formatHandle</td></tr>
 </table>
 <h2>Encoding</h2>
 <table>
 	<tr><th>Formato</th><th>Descrizione</th></tr>
 	<tr><td>3g2</td><td>3gp2 formatHandle</td></tr>
 	<tr><td>3gp</td><td>3gp formatHandle</td></tr>
 	<tr><td>RoQ</td><td>Id RoQ formatHandle</td></tr>
 	<tr><td>ac3</td><td>raw ac3</td></tr>
 	<tr><td>adts</td><td>ADTS AAC</td></tr>
 	<tr><td>aiff</td><td>Audio IFF</td></tr>
 	<tr><td>alaw</td><td>pcm A law formatHandle</td></tr>
 	<tr><td>amr</td><td>3gpp amr file formatHandle</td></tr>
 	<tr><td>asf</td><td>asf formatHandle</td></tr>
 	<tr><td>asf_stream</td><td>asf formatHandle</td></tr>
 	<tr><td>au</td><td>SUN AU Format</td></tr>
 	<tr><td>avi</td><td>avi formatHandle</td></tr>
 	<tr><td>crc</td><td>crc testing formatHandle</td></tr>
 	<tr><td>dv</td><td>DV video formatHandle</td></tr>
 	<tr><td>dvd</td><td>MPEG2 PS formatHandle (DVD VOB)</td></tr>
 	<tr><td>ffm</td><td>ffm formatHandle</td></tr>
 	<tr><td>flac</td><td>raw flac</td></tr>
 	<tr><td>flv</td><td>flv formatHandle</td></tr>
 	<tr><td>framecrc</td><td>framecrc testing formatHandle</td></tr>
 	<tr><td>gif</td><td>GIF Animation</td></tr>
 	<tr><td>gxf</td><td>GXF formatHandle</td></tr>
 	<tr><td>h261</td><td>raw h261</td></tr>
 	<tr><td>h263</td><td>raw h263</td></tr>
 	<tr><td>h264</td><td>raw H264 video formatHandle</td></tr>
 	<tr><td>image2</td><td>image2 sequence</td></tr>
 	<tr><td>image2pipe</td><td>piped image2 sequence</td></tr>
 	<tr><td>libnut</td><td>nut formatHandle</td></tr>
 	<tr><td>m4v</td><td>raw MPEG4 video formatHandle</td></tr>
 	<tr><td>matroska</td><td>Matroska File Format</td></tr>
 	<tr><td>mjpeg</td><td>MJPEG video</td></tr>
 	<tr><td>mmf</td><td>mmf formatHandle</td></tr>
 	<tr><td>mov</td><td>mov formatHandle</td></tr>
 	<tr><td>mp2</td><td>MPEG audio layer 2</td></tr>
 	<tr><td>mp3</td><td>MPEG audio layer 3</td></tr>
 	<tr><td>mp4</td><td>mp4 formatHandle</td></tr>
 	<tr><td>mpeg</td><td>MPEG1 System formatHandle</td></tr>
 	<tr><td>mpeg1video</td><td>MPEG video</td></tr>
 	<tr><td>mpeg2video</td><td>MPEG2 video</td></tr>
 	<tr><td>mpegts</td><td>MPEG2 transport stream formatHandle</td></tr>
 	<tr><td>mpjpeg</td><td>Mime multipart JPEG formatHandle</td></tr>
 	<tr><td>mulaw</td><td>pcm mu law formatHandle</td></tr>
 	<tr><td>null</td><td>null video formatHandle</td></tr>
 	<tr><td>nut</td><td>nut formatHandle</td></tr>
 	<tr><td>ogg</td><td>Ogg formatHandle</td></tr>
 	<tr><td>psp</td><td>psp mp4 formatHandle</td></tr>
 	<tr><td>rawvideo</td><td>raw video formatHandle</td></tr>
 	<tr><td>rm</td><td>rm formatHandle</td></tr>
 	<tr><td>rtp</td><td>RTP output formatHandle</td></tr>
 	<tr><td>s16be</td><td>pcm signed 16 bit big endian formatHandle</td></tr>
 	<tr><td>s16le</td><td>pcm signed 16 bit little endian formatHandle</td></tr>
 	<tr><td>s8</td><td>pcm signed 8 bit formatHandle</td></tr>
 	<tr><td>svcd</td><td>MPEG2 PS formatHandle (VOB)</td></tr>
 	<tr><td>swf</td><td>Flash formatHandle</td></tr>
 	<tr><td>u16be</td><td>pcm unsigned 16 bit big endian formatHandle</td></tr>
 	<tr><td>u16le</td><td>pcm unsigned 16 bit little endian formatHandle</td></tr>
 	<tr><td>u8</td><td>pcm unsigned 8 bit formatHandle</td></tr>
 	<tr><td>vcd</td><td>MPEG1 System formatHandle (VCD)</td></tr>
 	<tr><td>vob</td><td>MPEG2 PS formatHandle (VOB)</td></tr>
 	<tr><td>voc</td><td>Creative Voice File formatHandle</td></tr>
 	<tr><td>wav</td><td>wav formatHandle</td></tr>
 	<tr><td>yuv4mpegpipe</td><td>YUV4MPEG pipe formatHandle</td></tr>
 </table>
 <a name="9"></a>
 <h1>Built-in decoders and encoders</h1>
 <p>The JAVE built-in ffmpeg executable contains the following decoders and encoders:</p>
 <h2>Audio decoders </h2>
 <table>
   <tr><td>adpcm_4xm</td><td>adpcm_adx</td><td>adpcm_ct</td><td>adpcm_ea</td><td>adpcm_ea_r1</td></tr>
   <tr><td>adpcm_ea_r2</td><td>adpcm_ea_r3</td><td>adpcm_ea_xas</td><td>adpcm_ima_amv</td><td>adpcm_ima_dk3</td></tr>
   <tr><td>adpcm_ima_dk4</td><td>adpcm_ima_ea_eacs</td><td>adpcm_ima_ea_sead</td><td>adpcm_ima_qt</td><td>adpcm_ima_smjpeg</td></tr>
   <tr><td>adpcm_ima_wav</td><td>adpcm_ima_ws</td><td>adpcm_ms</td><td>adpcm_sbpro_2</td><td>adpcm_sbpro_3</td></tr>
   <tr><td>adpcm_sbpro_4</td><td>adpcm_swf</td><td>adpcm_thp</td><td>adpcm_xa</td><td>adpcm_yamaha</td></tr>
   <tr><td>alac</td><td>ape</td><td>atrac 3</td><td>cook</td><td>dca</td></tr>
   <tr><td>dsicinaudio</td><td>flac</td><td>g726</td><td>imc</td><td>interplay_dpcm</td></tr>
   <tr><td>liba52</td><td>libamr_nb</td><td>libamr_wb</td><td>libfaad</td><td>libgsm</td></tr>
   <tr><td>libgsm_ms</td><td>mace3</td><td>mace6</td><td>mp2</td><td>mp3</td></tr>
   <tr><td>mp3adu</td><td>mp3on4</td><td>mpc sv7</td><td>mpc sv8</td><td>mpeg4aac</td></tr>
   <tr><td>nellymoser</td><td>pcm_alaw</td><td>pcm_mulaw</td><td>pcm_s16be</td><td>pcm_s16le</td></tr>
   <tr><td>pcm_s16le_planar</td><td>pcm_s24be</td><td>pcm_s24daud</td><td>pcm_s24le</td><td>pcm_s32be</td></tr>
   <tr><td>pcm_s32le</td><td>pcm_s8</td><td>pcm_u16be</td><td>pcm_u16le</td><td>pcm_u24be</td></tr>
   <tr><td>pcm_u24le</td><td>pcm_u32be</td><td>pcm_u32le</td><td>pcm_u8</td><td>pcm_zork</td></tr>
   <tr><td>qdm2</td><td>real_144</td><td>real_288</td><td>roq_dpcm</td><td>shorten</td></tr>
   <tr><td>smackaud</td><td>sol_dpcm</td><td>sonic</td><td>truespeech</td><td>tta</td></tr>
   <tr><td>vmdaudio</td><td>vorbis</td><td>wavpack</td><td>wmav1</td><td>wmav2</td></tr>
   <tr><td>ws_snd1</td><td>xan_dpcm</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
 </table>
 <h2>Audio encoders </h2>
 <table>
   <tr><td>ac3</td><td>adpcm_adx</td><td>adpcm_ima_wav</td><td>adpcm_ms</td><td>adpcm_swf</td></tr>
   <tr><td>adpcm_yamaha</td><td>flac</td><td>g726</td><td>libamr_nb</td><td>libamr_wb</td></tr>
   <tr><td>libfaac</td><td>libgsm</td><td>libgsm_ms</td><td>libmp3lame</td><td>libvorbis</td></tr>
   <tr><td>mp2</td><td>pcm_alaw</td><td>pcm_mulaw</td><td>pcm_s16be</td><td>pcm_s16le</td></tr>
   <tr><td>pcm_s24be</td><td>pcm_s24daud</td><td>pcm_s24le</td><td>pcm_s32be</td><td>pcm_s32le</td></tr>
   <tr><td>pcm_s8</td><td>pcm_u16be</td><td>pcm_u16le</td><td>pcm_u24be</td><td>pcm_u24le</td></tr>
   <tr><td>pcm_u32be</td><td>pcm_u32le</td><td>pcm_u8</td><td>pcm_zork</td><td>roq_dpcm</td></tr>
   <tr><td>sonic</td><td>sonicls</td><td>vorbis</td><td>wmav1</td><td>wmav2</td></tr>
 </table>
 <h2>Video decoders</h2>
 <table>
   <tr><td>4xm</td><td>8bps</td><td>VMware video</td><td>aasc</td><td>amv</td></tr>
   <tr><td>asv1</td><td>asv2</td><td>avs</td><td>bethsoftvid</td><td>bmp</td></tr>
   <tr><td>c93</td><td>camstudio</td><td>camtasia</td><td>cavs</td><td>cinepak</td></tr>
   <tr><td>cljr</td><td>cyuv</td><td>dnxhd</td><td>dsicinvideo</td><td>dvvideo</td></tr>
   <tr><td>dxa</td><td>ffv1</td><td>ffvhuff</td><td>flashsv</td><td>flic</td></tr>
   <tr><td>flv</td><td>fraps</td><td>gif</td><td>h261</td><td>h263</td></tr>
   <tr><td>h263i</td><td>h264</td><td>huffyuv</td><td>idcinvideo</td><td>indeo2</td></tr>
   <tr><td>indeo3</td><td>interplayvideo</td><td>jpegls</td><td>kmvc</td><td>loco</td></tr>
   <tr><td>mdec</td><td>mjpeg</td><td>mjpegb</td><td>mmvideo</td><td>mpeg1video</td></tr>
   <tr><td>mpeg2video</td><td>mpeg4</td><td>mpegvideo</td><td>msmpeg4</td><td>msmpeg4v1</td></tr>
   <tr><td>msmpeg4v2</td><td>msrle</td><td>msvideo1</td><td>mszh</td><td>nuv</td></tr>
   <tr><td>pam</td><td>pbm</td><td>pgm</td><td>pgmyuv</td><td>png</td></tr>
   <tr><td>ppm</td><td>ptx</td><td>qdraw</td><td>qpeg</td><td>qtrle</td></tr>
   <tr><td>rawvideo</td><td>roqvideo</td><td>rpza</td><td>rv10</td><td>rv20</td></tr>
   <tr><td>sgi</td><td>smackvid</td><td>smc</td><td>snow</td><td>sp5x</td></tr>
   <tr><td>svq1</td><td>svq3</td><td>targa</td><td>theora</td><td>thp</td></tr>
   <tr><td>tiertexseqvideo</td><td>tiff</td><td>truemotion1</td><td>truemotion2</td><td>txd</td></tr>
   <tr><td>ultimotion</td><td>vb</td><td>vc1</td><td>vcr1</td><td>vmdvideo</td></tr>
   <tr><td>vp3</td><td>vp5</td><td>vp6</td><td>vp6a</td><td>vp6f</td></tr>
   <tr><td>vqavideo</td><td>wmv1</td><td>wmv2</td><td>wmv3</td><td>wnv1</td></tr>
   <tr><td>xan_wc3</td><td>xl</td><td>zlib</td><td>zmbv</td><td>&nbsp;</td></tr>
 </table>
 <h2>Video encoders </h2>
 <table>
   <tr><td>asv1</td><td>asv2</td><td>bmp</td><td>dnxhd</td><td>dvvideo</td></tr>
   <tr><td>ffv1</td><td>ffvhuff</td><td>flashsv</td><td>flv</td><td>gif</td></tr>
   <tr><td>h261</td><td>h263</td><td>h263p</td><td>huffyuv</td><td>jpegls</td></tr>
   <tr><td>libtheora</td><td>libx264</td><td>libxvid</td><td>ljpeg</td><td>mjpeg</td></tr>
   <tr><td>mpeg1video</td><td>mpeg2video</td><td>mpeg4</td><td>msmpeg4</td><td>msmpeg4v1</td></tr>
   <tr><td>msmpeg4v2</td><td>pam</td><td>pbm</td><td>pgm</td><td>pgmyuv</td></tr>
   <tr><td>png</td><td>ppm</td><td>qtrle</td><td>rawvideo</td><td>roqvideo</td></tr>
   <tr><td>rv10</td><td>rv20</td><td>sgi</td><td>snow</td><td>svq1</td></tr>
   <tr><td>targa</td><td>tiff</td><td>wmv1</td><td>wmv2</td><td>zlib</td></tr>
   <tr><td>zmbv</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
 </table>
 <a name="10"></a>
 <h1>Examples</h1>
 <p>From a generic AVI to a youtube-like FLV movie, with an embedded MP3 audio stream:</p>
 <pre>File source = new File(&quot;source.avi&quot;);<br />File target = new File(&quot;target.flv&quot;);<br />AudioAttributes audio = new AudioAttributes();<br />audio.setCodec(&quot;libmp3lame&quot;);<br />audio.setBitRate(new Integer(64000));<br />audio.setChannels(new Integer(1));<br />audio.setSamplingRate(new Integer(22050));<br />VideoAttributes video = new VideoAttributes();<br />video.setCodec(&quot;flv&quot;);<br />video.setBitRate(new Integer(160000));<br />video.setFrameRate(new Integer(15));<br />video.setSize(new VideoSize(400, 300));<br />EncodingAttributes attrs = new EncodingAttributes();<br />attrs.setFormat(&quot;flv&quot;);<br />attrs.setAudioAttributes(audio);<br />attrs.setVideoAttributes(video);<br />Encoder encoder = new Encoder();<br />encoder.encode(source, target, attrs);</pre>
 <p>Next lines extracts audio informations from an AVI and store them in a plain WAV file:</p>
 <pre>File source = new File(&quot;source.avi&quot;);<br />File target = new File(&quot;target.wav&quot;);<br />AudioAttributes audio = new AudioAttributes();<br />audio.setCodec(&quot;pcm_s16le&quot;);<br />EncodingAttributes attrs = new EncodingAttributes();<br />attrs.setFormat(&quot;wav&quot;);<br />attrs.setAudioAttributes(audio);<br />Encoder encoder = new Encoder();<br />encoder.encode(source, target, attrs);</pre>
 <p>Next example takes an audio WAV file and generates a 128 kbit/s, stereo, 44100 Hz MP3 file: </p>
 <pre>File source = new File(&quot;source.wav&quot;);<br />File target = new File(&quot;target.mp3&quot;);<br />AudioAttributes audio = new AudioAttributes();<br />audio.setCodec(&quot;libmp3lame&quot;);<br />audio.setBitRate(new Integer(128000));<br />audio.setChannels(new Integer(2));<br />audio.setSamplingRate(new Integer(44100));<br />EncodingAttributes attrs = new EncodingAttributes();<br />attrs.setFormat(&quot;mp3&quot;);<br />attrs.setAudioAttributes(audio);<br />Encoder encoder = new Encoder();<br />encoder.encode(source, target, attrs);</pre>
 <p>Next one decodes a generic  AVI file and creates another one with the same video stream of the source and a re-encoded low quality MP3 audio stream:</p>
 <pre>File source = new File(&quot;source.avi&quot;);<br />File target = new File(&quot;target.avi&quot;);<br />AudioAttributes audio = new AudioAttributes();<br />audio.setCodec(&quot;libmp3lame&quot;);<br />audio.setBitRate(new Integer(56000));<br />audio.setChannels(new Integer(1));<br />audio.setSamplingRate(new Integer(22050));<br />VideoAttributes video = new VideoAttributes();<br />video.setCodec(VideoAttributes.DIRECT_STREAM_COPY);<br />EncodingAttributes attrs = new EncodingAttributes();<br />attrs.setFormat(&quot;avi&quot;);<br />attrs.setAudioAttributes(audio);<br />attrs.setVideoAttributes(video);<br />Encoder encoder = new Encoder();<br />encoder.encode(source, target, attrs);</pre>
 <p>Next one generates  an AVI with MPEG 4/DivX video and OGG Vorbis audio:</p>
 <pre>File source = new File(&quot;source.avi&quot;);<br />File target = new File(&quot;target.avi&quot;);<br />AudioAttributes audio = new AudioAttributes();<br />audio.setCodec(&quot;libvorbis&quot;);<br />VideoAttributes video = new VideoAttributes();<br />video.setCodec(&quot;mpeg4&quot;);<br />video.setTag(&quot;DIVX&quot;);<br />video.setBitRate(new Integer(160000));<br />video.setFrameRate(new Integer(30));<br />EncodingAttributes attrs = new EncodingAttributes();<br />attrs.setFormat(&quot;mpegvideo&quot;);<br />attrs.setAudioAttributes(audio);<br />attrs.setVideoAttributes(video);<br />Encoder encoder = new Encoder();<br />encoder.encode(source, target, attrs);</pre>
 <p>A smartphone suitable video:</p>
 <pre>File source = new File(&quot;source.avi&quot;);<br />File target = new File(&quot;target.3gp&quot;);<br />AudioAttributes audio = new AudioAttributes();<br />audio.setCodec(&quot;libfaac&quot;);<br />audio.setBitRate(new Integer(128000));<br />audio.setSamplingRate(new Integer(44100));<br />audio.setChannels(new Integer(2));<br />VideoAttributes video = new VideoAttributes();<br />video.setCodec(&quot;mpeg4&quot;);<br />video.setBitRate(new Integer(160000));<br />video.setFrameRate(new Integer(15));<br />video.setSize(new VideoSize(176, 144));<br />EncodingAttributes attrs = new EncodingAttributes();<br />attrs.setFormat(&quot;3gp&quot;);<br />attrs.setAudioAttributes(audio);<br />attrs.setVideoAttributes(video);<br />Encoder encoder = new Encoder();<br />encoder.encode(source, target, attrs);</pre>
</body>
</html>