Schroedinger and FFmpeg
From Diracvideo
Contents |
[edit] Schroedinger and FFmpeg
Make sure you have libschroedinger (and libschroedinger-dev, if your distribution puts header files in a different package) installed. Optionally, you can also build the dirac codec libraries into ffmpeg which will give higher quality encoded pictures at the current time.
[edit] Get FFmpeg from svn
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
[edit] Build
./configure --enable-libdirac --enable-libschroedinger
make
The option '--enable-libdirac' must be used during configuration in order to pick-up the Dirac code during building. Similarly --enable-libschroedinger must be used to enable Schroedinger support. pkg-config is used to determine the location of Dirac and Schroedinger header files and libraries.
Note that on some systems pkg-config is not available by default and will have to be installed. FFmpeg expects to find Dirac and Schroedinger and associated libraries to be installed in the default install point /usr/local.
By default, Dirac Encoder for is used for encoding and Schroedinger decoder for decoding.
[edit] Sample Usage for encoding Dirac bitstreams
[edit] Creating raw Dirac bitstreams
If the output file has an extension of .drc then Dirac is the codec used to encode. Dirac and Schroedinger libraries produce compatible bitstreams. However the compression performance of the Schroedinger library is not on par with the Dirac library as yet. Hence, for raw Dirac bitstreams, Dirac is the default codec for encoding if both Dirac and Schro codecs are enabled. Work in on going to improve the compression performance of Schroedinger so that in future it will be the default codec used to encode Dirac bitstreams.
[edit] Constant quality encoding examples:
ffmpeg -s 720x576 -i input_file.yuv -qscale 70 default_output.drc
The -qscale flag controls the quality of the encoder output. The bit rate is not constant when this option is chosen. For the Dirac codec, the valid qscale range is 1-255. qf values is set to qscale/10.0 The higher the value of qscale, the better the quality. For Schroedinger, the valid qscale range is 1-100. The higher the value of qscale the better the quality. Values below 20 look rather horrible whereas 80 and above gives rather large files.
[edit] Constant bitrate encoding example:
ffmpeg -s 720x576 -i input_file.yuv -b 1500000 default_1.5Mbps_output.drc
The encoder will attempt to keep the bitrate constant at 1500000 bps.
Currently, the output from the encoder is exactly as it is written to the .drc encoded file.
[edit] Sample usage for decoding Dirac bitstreams
Both Dirac and Schroedinger codecs produce compatible bitstreams, i.e. the output of one codec can be decoded by the other. Dirac codec is used by default for decoding if both Dirac and Schroedinger codecs are enabled. Schroedinger codec is used for decoding if the Dirac decoder is disabled using the --disable-decoder=libdirac option during configure.
ffmpeg -i input.drc output_default.yuv
