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

Wes Morgan morganw at chemikals.org
Sat Nov 28 17:14:51 CET 2009


On Sat, 28 Nov 2009, James Hastings-Trew wrote:

> Wes Morgan wrote:
>> 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%.
> You didn't say what operating system you are using. If you are using Windows, 
> you might find some notes I made here helpful.
>
> http://videogeek.shacknet.nu/index.php?entry=entry090204-064824
>
> Essentially, you need a program called eac3to to demux the streams from the 
> .m2ts file, and then you need to process the audio and video separately, and 
> then mux the result back together at the end. Not sure if eac3to is available 
> on other platforms or not. I mostly did this stuff on a windows machine, so 
> YMMV.

Thanks for the input!

I'm doing all this on freebsd, although I had to use windows to rip the 
discs. All the files are on an ntfs paritition, so I can move them around 
and use eac3to to demux if necessary. ffmpeg seemed to have no problem 
doing it, so I'll probably try a test run with eac3to vs ffmpeg and see 
how the files compare.

As for audio sync, I've always read that separating the audio and video is 
devastating to the audio sync. Logically, that only should be the case if 
the number of frames of the the video stream changes or the audio is 
truncated somehow, but I've never tested it. Have you had any problems 
with a/v sync?

In step 3, you check the scaling with "scale=1280:-10", and use that in 
the final encode followed by a dsize. I thought that mencoder 
automatically updated the aspect ratio through both the crop and scale 
filters. Does the "dsize" filter correct for the slight difference in 
aspect ratios between 1280x544 and 1904x800 so the result is displayed 
properly? If not, isn't the image being ever so slightly distorted? Would 
it not have been better the undercrop to 1904x810 so it would scale to 
1280x544 with no distortion, even though it might leave some black pixels?


More information about the MEncoder-users mailing list