This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:standalone_mpeg-4_players [2010/04/13 19:31] j.m created |
tutorial:standalone_mpeg-4_players [2010/04/17 06:36] j.m |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Standalone MPEG-4 players ====== | ====== Standalone MPEG-4 players ====== | ||
- | This article tries to help you make your videos play on standalone MPEG-4 DVD players, whether they are [[http://www.divx.com/company/partner/certified_program.php|DivX Certified]] or not. | + | This article tries to help you make your videos play on standalone MPEG-4 DVD players, whether they are [[http://www.divx.com/en/partner/certified-programs|DivX Certified]] or not. |
===== The packed VOP hack ===== | ===== The packed VOP hack ===== | ||
Line 9: | Line 9: | ||
That does not cope very well with VFW (Video for Windows) limitation that more or less assumes one frame in/one frame out. | That does not cope very well with VFW (Video for Windows) limitation that more or less assumes one frame in/one frame out. | ||
- | To workaround this, [[http://www.divx.com/company/|DivX, Inc.]] introduced PB frames in AVI. To explain it, see the [[B-frames]] article. Basically they add a non coded image (N-VOP) after a frame containing both a P and a B frame. Some (most?) players choke or stutter on that as it artificially creates an additional frame. To detect that, they also put a specific marker in the user data section of the MPEG-4 stream. Some players use that information to switch to packed VOP mode, but it is not 100% reliable. Plus the stream is not 100% ISO compliant. | + | To workaround this, [[http://www.divx.com/en/company|DivX, Inc.]] introduced PB frames in AVI. To explain it, see the [[using:B-frames]] article. Basically they add a non coded image (N-VOP) after a frame containing both a P and a B frame. Some (most?) players choke or stutter on that as it artificially creates an additional frame. To detect that, they also put a specific marker in the user data section of the MPEG-4 stream. Some players use that information to switch to packed VOP mode, but it is not 100% reliable. Plus the stream is not 100% ISO compliant. |
* Rule #1: Don't use packed frames. With Avidemux you can't but with some other software you can. | * Rule #1: Don't use packed frames. With Avidemux you can't but with some other software you can. | ||
Line 26: | Line 26: | ||
If you have a huge amount of such files to convert you can use a script like: | If you have a huge amount of such files to convert you can use a script like: | ||
- | <code bash>#!/bin/bash | + | <code bash> |
+ | #!/bin/bash | ||
export SRC=/tmp/fma2 | export SRC=/tmp/fma2 | ||
export TGT=/tmp/fma3 | export TGT=/tmp/fma3 | ||
- | perl foreach.pl $SRC/*.avi "avidemux2 | + | perl foreach.pl $SRC/*.avi "avidemux2 \ |
- | --force-unpack --load $SRC/%f | + | --force-unpack --load $SRC/%f \ |
- | --audio-map --save-unpacked-vop | + | --audio-map --save-unpacked-vop \ |
- | $TGT/fixed_%f --quit"</code> | + | $TGT/fixed_%f --quit" |
+ | </code> | ||
===== GMC and Qpel ===== | ===== GMC and Qpel ===== | ||
Line 42: | Line 44: | ||
There is a way to get almost the same result using only one pass. Assuming your video is correctly done, the previous encoding already distributed quantizers and bitrate to get a good quality for a given size. Why not reuse that information? | There is a way to get almost the same result using only one pass. Assuming your video is correctly done, the previous encoding already distributed quantizers and bitrate to get a good quality for a given size. Why not reuse that information? | ||
- | To do so, set Xvid (or libavcodec MPEG-4) to use "Same Qz as input" mode. In that mode, they will encode each frame with the quantizer used previously to encode it. The result will have about the same size/quality compared to the original but using only one pass. | + | To do so, set Xvid (or libavcodec(nbsp)MPEG-4) to use "Same Qz as input" mode. In that mode, they will encode each frame with the quantizer used previously to encode it. The result will have about the same size/quality compared to the original but using only one pass. |
That can also be done using command line mode to process plenty of files in a row: | That can also be done using command line mode to process plenty of files in a row: | ||
- | <code bash>#!/bin/bash | + | <code bash> |
+ | #!/bin/bash | ||
export SRC=/tmp/fma2 | export SRC=/tmp/fma2 | ||
export TGT=/tmp/fma3 | export TGT=/tmp/fma3 | ||
Line 53: | Line 56: | ||
--audio-map --video-process --video-codec xvid4 | --audio-map --video-process --video-codec xvid4 | ||
--video-conf follow=1000 --save $ TGT/fixed_%f | --video-conf follow=1000 --save $ TGT/fixed_%f | ||
- | --quit"</code> | + | --quit" |
+ | </code> | ||
===== Muxing ===== | ===== Muxing ===== |