**Dirac patch for ffmpeg **Tested with ffmpeg svn revision 10630 **Original Author: Andrew Kennedy (dirac_dev@users.sourceforge.net) **Additional Contributors: Anuradha Suraparaju (asuraparaju@users.sourceforge.net) Bernhard Rosenkraenzer (bero@users.sourceforge.net) Dirac is an open-source video codec currently under development. Both the encoder and decoder have been integrated with ffmpeg. This patch is only a basic integration such that only the salient paremeters are currently passed from ffmpeg to Dirac. As Dirac develops, especially with the integration of a formalised bit-stream syntax, then more complex screnarios can be dealt with. Encoded Dirac files, with the right patch, can be played back using MPlayer. Please feel free to modify/add-to the code. These are the instructions for enabling Dirac support in ffmpeg source code. 1. Download Dirac 0.8.0 from http://sourceforge.net/projects/dirac/ 2. Unpack the Dirac source tar xvzf dirac-0.8.0.tar.gz 3. Build and Install cd dirac-0.8.0 ./configure make make install The last step installs the Dirac share encoder and decoder libraries in /usr/local/lib (which is the default install point). 3. Download ffmpeg svn revision 10630 svn checkout -r 10630 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg_trunk_rev_10630 4. Apply the patch cd ffmpeg_trunk_rev_10630 patch -p1 < ffmpegsvn_trunk_revision_10630-dirac-0.8.x.patch 6. Build and Install ./configure --enable-dirac make make install The option '--enable-dirac' must be used during configuration in order to pick-up the Dirac code during building. pkg-config is used to determine if dirac is available. Note that on some systems pkg-config is not available by default and will have to be installed. Sample Usage: (encoding) Constant quality encoding example: ffmpeg -s 720x576 -i input_file.yuv -vcodec dirac -strict -2 -qscale 15 dirac_output.drc Constant bitrate encoding example: ffmpeg -s 720x576 -i input_file.yuv -b 1500000 -vcodec dirac -strict -2 dirac_output.drc The encoder will attempt tp keep the bitrate constant at 1500000 bps. Interlaced encoding example: ffmpeg -s 720x576 -i input_file.yuv -flags ilme -vcodec dirac -strict -2 dirac_output.drc Currently, the output from the encoder is exactly as it is written to the .drc encoded file. The -qscale flag controls the quality of the Dirac encoder output. The bit rate is not constant when this option is choses. A qscale of 1 maps to dirac quality factor 10 and 30 maps to quality factor 1). The -b flag controls the bitrate (in bps) of Dirac encoder output. The Dirac encoder attempts to keep the output bitrate constant at the value specified. (decoding) ffmpeg -i input.drc output.yuv Dirac can also be invoked via ffmpeg using transcode after applying the transcode patch. transcode -i input.avi -x raw -i raw_input.avi -y ffmpeg -F dirac,null -o dirac_output.avi