|
The DivX H.264 Encoder is a sample tool for DivX Plus HD video encoding. It creates DivX Plus HD-compliant H.264 bitstreams that can be used in DivX Plus MKV files or as a compatibility reference. In response to your feedback after our Beta 1 release we've been working on the DivX Plus HD H.264 command line encoder, and in the first of several updates we are introducing several popularly requested features. These include a target quality mode, support for flagging sample aspect ratio, and support for input via stdin. Read on for more information! |
-br) and n-pass (-br -npass) bitrate-based modes that we described in our last tutorial you can now enable a preliminary implementation of quality-based rate-control whose goal is to provide a consistent perceived output quality across a wide variety of input material without exceeding data rate constraints for playback devices. By using the new -qf <int> argument you can specify a target quality in the range 0-51, with lower numbers implying a higher target quality, e.g.:DivX264 -i "Input.avs" -o "Output.264" -qf 18-qf <int> values) will produce larger files and you will need to experiment a little to find the setting that best balances your personal preferences. The target quality mode can be leveraged for compression checks by GUI applications and should produce similar quality to a 2-pass encoding at the same effective rate but in much less time.-sar argument. In its alpha release the encoder always assumed that pixels were square (1:1 SAR) and thus it was necessary to resize certain source material to ensure this was actually true. Because these adjustments are no longer necessary it's possible to achieve better picture resolution and less pre-processing time in the input pipeline. These pictures demonstrate just one common use case for SAR:
| SD Format | SAR |
|---|---|
| PAL 4:3 | 12:11 |
| PAL 16:9 | 16:11 |
| NTSC 4:3 | 10:11 |
| NTSC 16:9 | 40:33 |
-tff or -bff arguments only the following combinations of resolution and SAR are permitted:
| Interlaced resolution | Support SARs |
|---|---|
| 1920x1080i60 | 1:1 (16:9 frame) |
| 1920x1080i50 | 1:1 (16:9 frame) |
| 1440x1080i60 | 1:1 (4:3 frame), 4:3 (16:9 frame) |
| 1440x1080i50 | 1:1 (4:3 frame), 4:3 (16:9 frame) |
| 720x480i60 | 1:1, 40:33 (16:9 frame), 10:11 (4:3 frame) |
| 720x576i50 | 1:1, 16:11 (16:9 frame), 12:11 (4:3 frame) |
| 704x480i60 | 1:1, 40:33 (16:9 frame), 10:11 (4:3 frame) |
| 704x576i50 | 1:1, 16:11 (16:9 frame), 12:11 (4:3 frame) |
| 640x480i60 | 1:1 (4:3 frame) |
| 480x480i60 | 1:1, 20:11 (16:9 frame), 15:11 (4:3 frame) |
| 480x576i50 | 1:1, 24:11 (16:9 frame), 18:11 (4:3 frame) |
| 352x480i60 | 1:1, 80:33 (16:9 frame), 20:11 (4:3 frame) |
| 352x576i50 | 1:1, 32:11 (16:9 frame), 24:11 (4:3 frame) |
ffmpeg [[infile options][`-i' infile]]... {[outfile options] outfile}...-i, crop 8 pixels from the height using -cropbottom, resize to 1280x720 using -s, and convert the frame rate using -r. The first part of the command line might look as follows:ffmpeg.exe -i "C:\SomeFolder\MyInput.avi" -cropbottom 8 -s 1280x720 -r 24000/1001-f and -pix_fmt to tell FFmpeg that we want to output YV12 planar video (the raw format that the DivX Plus HD encoder expects via stdin), and to write those raw frames to stdout, which we will later pipe to the encoder's stdin. To do that we just put a "-" character where we'd normally write the output filename. This makes our complete command-line for FFmpeg look like this:ffmpeg.exe -i "C:\SomeFolder\MyInput.avi" -cropbottom 8 -s 1280x720 -r 24000/1001 -f rawvideo -pix_fmt yuv420p --" character where we'd normally write a file name. Because the only data the encoder will see is raw video frames we also have to tell it the resolution and frame rate of the input video on the command line when using the stdin feature. Let's use the new target quality mode (-qf) in conjunction with the stdin feature to create a high quality file in just one pass:divx264.exe -i - -y 1280x720 -fps 24000/1001 -qf 18 -o "C:\SomeFolder\MyOutput.264"|" to pipe FFmpeg's stdout handle to the DivX Plus HD encoder's stdin handle:ffmpeg.exe -i "C:\SomeFolder\MyInput.avi" -cropbottom 8 -s 1280x720 -r 24000/1001 -f rawvideo -pix_fmt yuv420p - | divx264.exe -i - -y 1280x720 -fps 24000/1001 -qf 18 -o "C:\SomeFolder\MyOutput.264"MKVMerge.exe -o "C:\SomeFolder\MyMKVVideo.mkv" --default-duration 0:1001/24000s "C:\SomeFolder\MyOutput.264"| Rate (Numerator) | Scale (Denominator) | Approximate FPS = Rate / Scale | Max Dimensions | Min Dimensions |
|---|---|---|---|---|
| 60 | 1 | 60 | 1280x720 | 320x240 |
| 60000 | 1001 | 59.940 | 1280x720 | 320x240 |
| 50 | 1 | 50 | 1280x720 | 320x240 |
| 30 | 1 | 30 | 1920x1080 | 320x240 |
| 30000 | 1001 | 29.970 | 1920x1080 | 320x240 |
| 25 | 1 | 25 | 1920x1080 | 320x240 |
| 24 | 1 | 24 | 1920x1080 | 320x240 |
| 24000 | 1001 | 23.976 | 1920x1080 | 320x240 |
-start. In conjunction with the existing -frames argument it is possible to specify a range of frames to be encoded, which can be useful for conducting short tests as well as removing unwanted sequences from captured material. An example of using both features to encode only frames 1000 through 2999 is as follows:divx264.exe -i "MyInput.avs" -o "C:\SomeFolder\MyOutput.264" -qf 18 -start 1000 -frames 2000-start argument currently works only with input from file because seeking is not possible when reading from stdin. When using stdin you should use options in the decoding application in place of -start and -frames, for example FFmpeg's -ss and -t arguments. Ctrl+C or Ctrl+Break while it is running.
Known issues for DivX Plus HD H.264 Encoder Beta 2
The following are known issues in this version:
ConvertToYV12() to your script to convert video to YV12 colorspace.
Downloading DivX Plus HD H.264 Encoder Beta 2
To download this beta you need to create a free DivX Labs account then join the Project Rémoulade Apps group. Downloads for Project Rémoulade are available at the top of the group homepage for signed-in members.
We want to hear your feedback! Please submit your comments and questions to the DivX Plus forum (requires sign-in).
If your feedback relates to performance issues or software stability, please consider attaching some of the following to your post:
MSInfo32 into the Run box on your Start menu, so that we can see information about the operating system, running software and application errors.