ar
3rd March 2011, 16:39
Part 1. Multiplexing problem
I'm trying to encode DVD-compliant sources to output them to dvdauthor. AFAIK, i need to make mpeg-ts stream with NAV-sectors and empty VOBU-sectors. For example, one of the following lines would do what i want:
mplex -f 8 -o test_mux_mplex.vob test.m2v test.ac3
mencoder -noskip -mc 0 -oac copy -ovc copy\
-of mpeg -mpegopts format=dvd:tsaf:vwidth=720:vheight=576:vaspect=4/3:vframerate=25\
-audiofile test.ac3 test.m2v -o test_mux_mencoder.vob
And i noticed that either mplex or mencoder dropped some frames during multiplexing. I meen input mpeg-es (m2v) file consists of few more frames then output VOB.
Next wrote this script:
Video_Blank = BlankClip(length=1500,\
width=720,\
height=576,\
pixel_type="YV12",\
fps=25,\
audio_rate=48000,\
stereo=true,\
sixteen_bit=true,\
color=$000000).\
AssumeFrameBased().\
ShowFrameNumber(x=32,\
y=64,\
font="DejaVu Sans",\
size=32,\
text_color=$E0E0E0,\
halo_color=$404040).\
ColorYUV(levels="PC->TV")
return Video_Blank
Script produces progressive PAL clip with 1500 black frames with frame numbers from 0 to 1499 printed on each frame. Then i encoded video to mpeg-2 and ac3:
wine wavi test1500.avs - /R |\
ffmpeg -ar 48000 -ac 2 -acodec pcm_s16le -f s16le -i pipe:0\
-acodec ac3 -ab 192k -f ac3 test.ac3 &&\
wine avs2yuv -raw test1500.avs - | mencoder -profile mpeg2-vhq-pal-p-i420-bitrate-pass1\
-oac copy -lavcopts vbitrate=9000:aspect=4/3:threads=4\
-audiofile test.ac3 -o test.vob -
Clip in test.vob have 1500 frames and audio stream, also it can be passed to dvdautor.
Even if i tried to demux video, mpeg-es (m2v) still has 1500 frames.
mpeg2desc -v 0 -o test.m2v < test.vob
But when i multiplexing m2v and ac3 with mplex or mencoder:
mplex -f 8 -o test_out_mplex.vob test.m2v test.ac3 &&\
mencoder -oac copy -ovc copy -of mpeg\
-mpegopts format=dvd:tsaf:vwidth=720:vheight=576:vaspect=4/3:vframerate=25\
-noskip -mc 0 -audiofile test.ac3 test.vob\
-o test_mux_mencoder.vob
both clips in test_mux_mencoder.vob and test_out_mplex.vob have 1499 frames.
Then i made index for avisynth of two files. Both muxers drops frame with stamp «1498» (the last frame should have stamp «1499»).
If i run this sequence one more time then mplex drops one more frame:
mpeg2desc -v 0 -o test_again.m2v < test_out_mplex.vob &&\
mplex -f 8 -o test_again.vob test_again.m2v test.ac3
Clip in test_again.vob have only 1498 frames (without frame stamped with «1499»).
Why this occurs?
I'm trying to encode DVD-compliant sources to output them to dvdauthor. AFAIK, i need to make mpeg-ts stream with NAV-sectors and empty VOBU-sectors. For example, one of the following lines would do what i want:
mplex -f 8 -o test_mux_mplex.vob test.m2v test.ac3
mencoder -noskip -mc 0 -oac copy -ovc copy\
-of mpeg -mpegopts format=dvd:tsaf:vwidth=720:vheight=576:vaspect=4/3:vframerate=25\
-audiofile test.ac3 test.m2v -o test_mux_mencoder.vob
And i noticed that either mplex or mencoder dropped some frames during multiplexing. I meen input mpeg-es (m2v) file consists of few more frames then output VOB.
Next wrote this script:
Video_Blank = BlankClip(length=1500,\
width=720,\
height=576,\
pixel_type="YV12",\
fps=25,\
audio_rate=48000,\
stereo=true,\
sixteen_bit=true,\
color=$000000).\
AssumeFrameBased().\
ShowFrameNumber(x=32,\
y=64,\
font="DejaVu Sans",\
size=32,\
text_color=$E0E0E0,\
halo_color=$404040).\
ColorYUV(levels="PC->TV")
return Video_Blank
Script produces progressive PAL clip with 1500 black frames with frame numbers from 0 to 1499 printed on each frame. Then i encoded video to mpeg-2 and ac3:
wine wavi test1500.avs - /R |\
ffmpeg -ar 48000 -ac 2 -acodec pcm_s16le -f s16le -i pipe:0\
-acodec ac3 -ab 192k -f ac3 test.ac3 &&\
wine avs2yuv -raw test1500.avs - | mencoder -profile mpeg2-vhq-pal-p-i420-bitrate-pass1\
-oac copy -lavcopts vbitrate=9000:aspect=4/3:threads=4\
-audiofile test.ac3 -o test.vob -
Clip in test.vob have 1500 frames and audio stream, also it can be passed to dvdautor.
Even if i tried to demux video, mpeg-es (m2v) still has 1500 frames.
mpeg2desc -v 0 -o test.m2v < test.vob
But when i multiplexing m2v and ac3 with mplex or mencoder:
mplex -f 8 -o test_out_mplex.vob test.m2v test.ac3 &&\
mencoder -oac copy -ovc copy -of mpeg\
-mpegopts format=dvd:tsaf:vwidth=720:vheight=576:vaspect=4/3:vframerate=25\
-noskip -mc 0 -audiofile test.ac3 test.vob\
-o test_mux_mencoder.vob
both clips in test_mux_mencoder.vob and test_out_mplex.vob have 1499 frames.
Then i made index for avisynth of two files. Both muxers drops frame with stamp «1498» (the last frame should have stamp «1499»).
If i run this sequence one more time then mplex drops one more frame:
mpeg2desc -v 0 -o test_again.m2v < test_out_mplex.vob &&\
mplex -f 8 -o test_again.vob test_again.m2v test.ac3
Clip in test_again.vob have only 1498 frames (without frame stamped with «1499»).
Why this occurs?