[MEncoder-users] Problems encoding from blu-ray m2ts

Wes Morgan morganw at chemikals.org
Sat Nov 28 03:51:58 CET 2009


I'm trying to transcode a blu-ray m2ts file and having a devil of a time 
getting mencoder to work reliably. If anyone can see anything I'm doing 
wrong from the information below or has some suggestions I'd be very 
grateful. mencoder, ffmpeg and x264 are all built from snapshots only a 
few days old.

The output from mplayer -identify was not very helpful, but ffmpeg 
identifies the streams as:

Input #0, mpegts, from 'National Parks D2.m2ts':
   Duration: 02:11:24.04, start: 11.617322, bitrate: 35837 kb/s
   Program 1
     Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 
16:9], 29.97 tbr, 90k tbn, 59.94 tbc
     Stream #0.1[0x1100]: Audio: truehd, 48000 Hz, 6 channels, s32
     Stream #0.2[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
     Stream #0.3[0x1101]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
     Stream #0.4[0x1102]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
     Stream #0.5[0x1200]: Subtitle: pgssub
     Stream #0.6[0x1201]: Subtitle: pgssub

ffmpeg is able to correctly extract any of the streams and properly 
transcode the truehd to ac3. Mencoder runs for a bit and dies with the 
dreaded "too many audio packets in the buffer" line when trying to process 
the truehd stream into ac3. I can't seem to get it to copy the 5.1 channel 
(stream 0.2 in ffmpeg) with any manner of -ausid, but with some fiddling I 
was able to get it to use the stereo stream (0.3) and work past the audio 
packet error. However, it now sometimes stops inexplicably in the middle 
of the encode without any any errors. Restarting with the exact same 
options will sometimes let it finish the pass, sometimes not. Setting the 
message level to all=6, this is the output just before stopping (this 
time) at only 66%.

Commandline:

mencoder -alang en -oac lavc -ovc x264 -sws 10 -aid 0x1101 -channels 2
-vf pullup,softskip,scale=-11:720:::5,unsharp=l3x3:1:c3x3:1,harddup
-aspect 16/9 -lavcopts acodec=ac3:abitrate=640 -x264encopts 
deblock=-1,-1:qpmin=12:qpmax=30:subme=5:qcomp=0.5:partitions=i8x8,i4x4,p8x8,p4x4,b8x8:8x8dct:me=umh:bframes=3:b_pyramid=normal:trellis=2:direct=auto:level_idc=41:turbo=2:threads=4:bitrate=4126:ref=5:pass=1 
-msgmodule -msglevel all=6 -o "pass1.avi" "00014.m2ts"

Output before stopping short:

DEMUX: PARSE_PMT(1 INDEX 3), STREAM: 3, FOUND pid=0x1102 (4354), type=0x2000, ES_DESCR_LENGTH: 12, bytes left: 10
DEMUX: PARSE_PMT(1 INDEX 4), STREAM: 4, FOUND pid=0x1200 (4608), type=0xffffffff, ES_DESCR_LENGTH: 0, bytes left: 5
DEMUX: PARSE_PMT(1 INDEX 5), STREAM: 5, FOUND pid=0x1201 (4609), type=0xffffffff, ES_DESCR_LENGTH: 0, bytes left: 0
DEMUX: ----------------------------
DEMUXER: ds_fill_buffer: EOF reached (stream: video)
DEMUXER: ds_fill_buffer: EOF reached (stream: video)
DEMUXER: ds_fill_buffer: EOF reached (stream: video)
MENCODER:
Flushing video frames.
MUXER: Writing index...


Error trying to encode truehd stream to ac3:

Pos:  19.4s    713f ( 0%)  6.34fps Trem: 642min 6589mb  A-V:0.040 [7653:640]
Too many audio packets in the buffer: (4097 in 543820 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Too many audio packets in the buffer: (4097 in 543820 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Too many audio packets in the buffer: (4097 in 543820 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.


More information about the MEncoder-users mailing list