- Dr.DivX
Dr. DivX is an application created by
DivX, Inc. that is capable of transcoding many video formats toDivX encoded video.Version
Original version
Dr. DivX was originally a closed source encoding application that was based upon royalty charging libraries. This version terminated at 1.06 for DivX 5.21.
OSS version
A new
open source (LGPL) version was begun after DivX 6 shipped, after many complaints that the new encoder tool was inadequate. While open source, the project is currently implemented by one programmer employed by DivX, Inc. Because the original application used closed libraries, work had to begin from scratch, and the features of old Dr. DivX had to be re-added one by one.Container
Typically the encoded video is muxed into the standard
AVI media container for the widest device compatibility. However, this offers fewer features than other container formats, including the DivX Media Format introduced with version 6 of the DivX codec.Multi-Pass Encoding
Multi pass, or dual pass encoding, generally takes as much as twice as long as single pass. However, enabling this mode does not cause any file output compatibility issues, and provides for a more even distribution of bits across the length of the encoded file, allocating them where they make the most noticeable difference to quality.
Quantization
Typically H.263 optimized is now recommended as the default quantization matrix with DivX encoding. In simple terms this can be described as a softening matrix, better suited to lower bit rates. In comparison the MPEG-2 matrix, can be likened to a sharpening filter, better suited to higher bit rates.
Frame Control
Various frame types are used under the
MPEG-4 standard, which can be seen as fixed points, to which motion changes are referenced.*I-frame - This is the fundamental and most complete frame type, which stores all data and from which motion changes are described.
*P-Frame - Stores differences between I-Frames or other P-frames.
*B-frame - This is a bidirectional frame, which stores the differences between past or future frames. The most compressible frame type, holding least information, typically used in fast action sequences. Not enabled in all profiles.For bidirectional (B-frame) encoding the DivX codec offers two options:
*Adaptive Single Consecutive - This typically offers the best overall compression, since it limits the number of B-Frames that can be inserted close together in fast moving sequences. Since the human eye perceives details more accurately in slow moving or stationary scenes, the bits are more effectively allocated to those scenes.
*Adaptive Multiple Consecutive - Will give smoother motion, but at the expense of file size, since no limit on consecutive frames is imposed.Keyframes
Keyframes, are the pictures you see when you fast forward through a DVD. They are inserted by one of two methods under MPEG-4.
*Max Keyframe interval - typically this is done by multiplying the framerate of the movie (eg. 23.976 or 25 or 29.97) by 10 (eg. 240, 250, 300), to deliver an automatic keyframe insert every 10 seconds. Typically left at the default value under DivX.
*Keyframe threshold - this intelligently tracks the percentage of blocks not tracked by the motion search algorithm. Typically it is best left at 50%, but can be varied between 40% and 60%. For example, at default, if more than 50% of blocks have changed between frames, a new key frame is inserted.Resize filter
Bicubic (Normal) is the preferred option, offering superior quality to the simpler (and faster) bilinear option. Image operations such as sharpening, are typically better performed with filters, whose output are more customisable. Frame cropping, where black bars on wide screen movies are removed from the area to be encoded, can save otherwise wasted bits.
ound
Typically the AVI files contain MP3 audio, as this is part of the baseline DivX profile. 128 kbit/s CBR is a standard audio bit rate, however 192 kbit/s offers optimal quality. MP3 offers the widest device compatibility, although it is possible to encode the files with other audio types, such as Dolby AC-3 and AAC.
The 'Audio boost' feature is enabled by default in Dr. DivX OSS. It evens out sound levels to a more consistent level across the file length. On poor quality audio tracks, such as sometimes found on older films, this improves apparent audio quality.
Profiles
Profiles are used to apply a group of pre-set variables to a job. An encode can be set to produce a fixed quality, or file size, such as 699 MB (one CD). Some options are excluded from the baseline DivX profiles, to maintain wider hardware compatibility. If you wish to use these more advanced codec features, you will need to select an "unconstrained" profile option. Some more recent hardware chipsets (>2005) do support these features.
*QPEL - Tracks motion changes more precisely sharpening images. Tends to work best on mid range rate bit rates. Low rates are too blocky to gain advantage from the finer intra-scene motion detailing, and high bit rates adequately capture all motion details anyway.
*GMC - Improves compression by describing motion in a collective blockFilters
The original Dr. DivX featured VirtualDub filter compatibility. Avisynth script input compatibility was added in version 2.0.1 of the OSS version [http://labs.divx.com/node/218] . Filter compatibility enables manipulation of the source before the codec begins compression. This may be to deliver a certain look, or more commonly to compensate for imperfections in the source files. For example, to smooth out low level
MPEG-2 compression artifact s. While the DivX codec does have a pre-processing / noise reduction option, external filters generally provide more precise options, and when applied at appropriate settings, offer superior quality. However, this may be at the expense of encoding speed.Temporal
[http://home.earthlink.net/~casaburi/download/ Temporal filters] are ideal for heavy noise i.e VHS / analogue TV sources. The temporal filter should be applied first in a filter chain. They work (in simple terms) by comparing each frame to the one previous and after, and averaging the difference. Thus random noise tends to be blended out. Advanced features in some temporal filters include:
*Pixel locking - where if a pixel is surrounded by identical colors, it is assumed to be noise and locked to the same color. This can cause 'ghosting' if applied at too high a level.
*Scene change thresholds - for example if more than 30% of the pixels are detected to have changed between frames, the temporal filter is not applied. This reduces apparent 'ghosting.'2D
[http://neuron2.net/2dcleaner.html 2D filters] are ideal for tidying up low level compression artifact noise on higher quality sources. They look only at one frame at a time, and seek to average out color patterns. If turned up too high, 2D filters tend to soften images, and lower overall detail levels.
Cartoons are known to present specific issues for MPEG-4 based codecs, and require the use of quality 2D filters to obtain effective results. [http://neuron2.net/hiq/smoothhiq.html Smart Smoother High Quality] was developed for exactly this type of application, optimized for quality at the expense of speed.
Visual
Other common visual filters include brightness, contrast, color, sharpen, blur, cartoon, emboss, deblocking, denoising, old film restoration, and even subtitle / logo removal.
Compressibility
A test posted to the Doom9 forums [http://forum.doom9.org/showthread.php?t=51181] , suggested up to 20% gains in compressibility could be achieved by pre-filtering DVD sources. [http://neuron2.net/hiq/smoothhiq.html Smart Smoother High Quality] proved to be the most effective, blending out low level MPEG-2 compression artifacts into even blocks of more easily compressible fixed color. The DivX codec noise filter has a similar function, but is less easily customised.
Denoise filter name, time taken compared to unfiltered, file size compared to unfiltered
*None 3:20 (100%) 26,3 (100%)
*Undot() 3:21 (101%) 25.8 (98%)
*Unfilter(-5,-5) 3:22 (101%) 23.5 (89%)
*Mergechroma(blur(1.3)) 3:30 (105%) 25,9 (98%)
*DNR2() 3:31 (106%) 26.7 (102%) (!?)
*temporalsoften(2,3,3,2,6) 3:34 (107%) 25,5 (97%)
*temporalsoften(3,5,5,2,10) 3:42 (111%) 25,1 (95%)
*STMedianFilter(8,15,4,7) 3:43 (112%) 26.2 (100%)
*TemporalCleaner() 3:45 (113%) 25.9 (98%)
*temporalsoften(4,8,8,2,10) 3:47 (114%) 24,9 (95%)
*fluxsmooth() 3:50 (115%) 24,2 (92%)
*Deen() 3:56 (118%) 22.4 (85%)
*convolution3d(movielq) 3:58 (119%) 25,0 (95%)
*convolution3d(moviehq) 3:59 (120%) 25,6 (97%)
*Peachsmoother() 4:03 (122%) 24.3 (92%)
*SpaceDust() 4:07 (124%) 22,2 (84%)
*convolution3d("vhsbq") 4:23 (132%) 25.1 (95%)
*FaeryDust() 12:14 (367%) 23,9 (91%)
*GoldDust() 12:45 (383%) 20,5 (78%)
*PixieDust() 12:48 (384%) 22,3 (85%)
*SmoothHiQ(7,20,25,230,5) 14:10 (425%) 20.6 (78%)Issues
While a multi format encoder, the most common source is DVD VOB files. One persistent issue is audio sync, with various fixes incorporated into Dr. DivX. For example, deleting small fragment files within the main audio streams.
External links
* [http://labs.divx.com/DrDivX Dr.DivX]
* [http://www.compression.ru/video/ MSU free filters]
* [http://neuron2.net/hiq/smoothhiq.html Smart Smoother High Quality]
* [http://arstechnica.com/guides/tweaks/cleaning.ars Digital Video Cleaning without the Elbow Grease]
* [http://www.digital-digest.com/dvd/articles/dvdtodivx.html DVD to DivX (XviD) Conversion Guide]
* [http://www.divx-digest.com/articles/divx6_setup_page1.html DivX 6 Setup Guide]References
Wikimedia Foundation. 2010.