View Full Version : Using MEncoder to transcode Blu Ray movies
Turtleggjp
18th January 2010, 05:59
I've transcoded a few Blu Ray movies already in the Windows world, so I know a lot of the basics about Ripping and decrypting (I use AnyDVD HD). I will still plan on using Windows for the "prep work," but I am interested in moving the "grunt work" over to Linux. Reasons are:
1. I like Linux, and I would like to learn how to do more things there.
2. I heard that the 64-bit version of x264 has a good speed improvment in Linux.
The system I will be doing this with is a Core2 Duo Wolfdale 3.16 GHz with a GeForce 9400 motherboard, so it is not only nice and powerful (ok, it's no Core i7), but it is also VDPAU capable. Ideally, I would like to use Mencoder, and decode the source using one of the VDPAU decoders, maybe do some simple cropping, and then encode it to MPEG4-AVC using x264. This seems to be possible, but I just wanted to verify before I dive into it. Some simple command line examples would be great. Also, can this all be done using 64-bit code? I know I may have to build MPlayer/MEncoder myself, so I'm willing to do that if needed. Thanks for your advice.
Matt
P.S. I mentioned "prep work" earlier. I know how to get the video into a .mkv file using eac3to or a stripped down .m2ts file using tsMuxeR (both in Windows). Which container format works better as input for MEncoder?
fangorn
18th January 2010, 09:35
Hi,
Nowadays you can do everything needed for BluRay conversion in 64bit linux. I am using .ts or .mkv containers mostly. makemkv and tsMuxeR are both avaliable on linux and work quite well.
Also I created a collection of scripts for video conversion.
It is centered around full batch capability, so it makes no difference if you start one conversion job or hundred in a row. There are quite a few options, but you have to provide them at startup or the scripts assume something sensible.
I dont have experience with SUP subtitles though. But I will have to look into it. My scripts can handle vobsub and text format subtitles already and if possible should either support SUP or convert it in the future.
The scripts (and documentation) can be found here: http://forums.gentoo.org/viewtopic-t-744041-highlight-.html
In your case you need blu2mkv. It depends on two other scripts presented there and a quite recent version of mencoder, x264, ffmpeg. I use the svn/git versions usually.
nm
18th January 2010, 11:34
Ideally, I would like to use Mencoder, and decode the source using one of the VDPAU decoders, maybe do some simple cropping, and then encode it to MPEG4-AVC using x264.
Currently VDPAU can only be used for playback. Reading the output back to main memory for further processing is not supported by FFmpeg and MEncoder. This would be interesting when using hardware deinterlacing for 1080i, or when downscaling, but in most cases the gained CPU time is negligible compared to H.264 encoding.
cord-factor
18th January 2010, 18:22
Maybe you should use DumpHD (http://forum.doom9.org/showthread.php?t=123111) and ffmpeg instead...
derrensmiths
20th January 2010, 07:17
Hi,
Why we are using DumpHD and ffmpeg instead...
cord-factor
20th January 2010, 22:15
Transcode of BD is not realtime process (it's not a video capture), therefore mplayer's VDPAU is useless. However, the only format that mencoder has fully support on output is avi (for HD avi is not so good). ffmpeg supports more formats and is preferable for this.
Moreover, the BD can be encrypted, in this case DumpHD is only software, that can read/dump it /AFAIK/.
nm
21st January 2010, 01:15
Transcode of BD is not realtime process (it's not a video capture), therefore mplayer's VDPAU is useless. However, the only format that mencoder has fully support on output is avi (for HD avi is not so good).
MEncoder can output H.264 elementary streams or they can be extracted from AVI before muxing to some more suitable container (with separately encoded audio). But as you said, ffmpeg or using x264 directly is a good alternative if there's no need for MEncoder's filters. HandBrakeCli is also pretty nice.
Moreover, the BD can be encrypted, in this case DumpHD is only software, that can read/dump it /AFAIK/.
There's MakeMKV. The beta is still free as in beer and it handles BD+.
fangorn
21st January 2010, 10:31
@cord-factor
i tried using ffmpeg multiple times - for exactly the multiple output containers it supports. But in the end I always had problems automating it. And I was not able getting my hands on the rules, what is necessary if input has one, two or more audio streams, zero, one or more subtitle streams, videotext streams from HDTV, and other features. Even for the most simple case (extract video and default audio stream and copy to new file) I could not get a working solution that is independent of the input.
Do you have a working command line/script for ffmpeg usage that I could start with? My scripts work for that usage cases that I intended them for, but I have some more usage cases that I am quite stuck atm. Especially concerning HDTV rips, that I plainly speaking cannot process atm.
Or is there an advanced tutorial that I have missed? All the stream mappings I found are very basic and I did not find switches to "ignore <type> streams" and so on.
cord-factor
21st January 2010, 17:51
I am not sure about HDTV (I haven't it yet). But as for .m2ts (BDRemux) I did transcode different streams separately.
fangorn
22nd January 2010, 11:59
Yeah, I tried that too, but ended up with sync problems 50% of the time.
That is why I use mencoder with AVI container as intermediate. It only has sync problems with DTS audio from HD sources, but I found a way around it.
And I have created a script to handle AVI sources and transmux it to several output containers (MKV, MP4, TS, M2TS) optionally joined with external audio streams, subtitles, chapter data, cover art (MKV only). Also it reencodes audio automatically if the existing format is inapropriate for the selected container/x264-preset. This one comes in really handy. :)
cord-factor
24th January 2010, 15:47
Yeah, I tried that too, but ended up with sync problems 50% of the time.
That is why I use mencoder with AVI container as intermediate. It only has sync problems with DTS audio from HD sources, but I found a way around it.
And I have created a script to handle AVI sources and transmux it to several output containers (MKV, MP4, TS, M2TS) optionally joined with external audio streams, subtitles, chapter data, cover art (MKV only). Also it reencodes audio automatically if the existing format is inapropriate for the selected container/x264-preset. This one comes in really handy. :)
Aha, if the source has LPCM audio there is no problems with a-v sync. But if it has any 'VBR' audio, loss of sync occurs fairly often. I sussually extract such audio to PCM stream, encode video (audio is copying), encode audio (video is copying), and then mux streams to mkv.
But it is the easy step, the hard one is to get the content from disk correctly (it is not always possible, from my experience :rolleyes: ).
fangorn
25th January 2010, 09:09
Yeah, recoding Audio would be an option, but I have my problems with that. ;-)
Normally I just copy whatever comes by.
I was looking into reencoding audio using mencoder and other programs for avi2mkv, but I never tested it thoroughly (concerning more than sync issues). OK, for mobile devices the sound quality is a minor issue, but my scripts are designed for archiving mainly.
Regarding "get the content from disk correctly" I am not that fundamentalistic. If everything else fails, there is always the option of virtualbox, windows and the proper software.
cord-factor
26th January 2010, 13:07
offtop/flood
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.