View Full Version : Blu-ray to MP4
Casbar77
8th March 2011, 20:37
Hey guys,
I've been using handbrake to make DVD rips for a number of years. Through handbrake and a lot of reference material, I've become familiar with the different settings in x264 as well as just the mp4 encoding standard.
So now I would like to compress and encode my blu-ray collection. I'm missing something in the pre-encode steps because x264 doesn't understand what I'm feeding it. Let me just walk through it:
Rip blu-ray image using AnyDVD-HD
Demux the video stream using eac3to ( *.h264 extension)
Demux the dts audio track using eac3to [using -down2 and -mixlfe]
Re-encode the [output wav] audio [files] using FAAC and condense to 2 channels
Re-encode video track using x264
Mux various tracks into single file using mp4box
What's not working is the video encoding. The video stream has no meta data since it's a raw stream off the blu-ray, so x264 doesn't know what to do with it. What do I need to do to make this work?
Thanks for any and all help!
edit: made technical corrections
ramicio
8th March 2011, 21:13
Get something like DGAVCIndex (http://neuron2.net/dgavcdecdi/dgavcdecdi.html) or DGDecNV (http://neuron2.net/dgdecnv/dgdecnv.html) and avisynth (http://avisynth.org/mediawiki/Main_Page). Simply speaking x264 looks for an uncompressed AVI input.
For the audio I would recommend using eac3to to make a WAV, with the -down2 switch, and preferably -mixlfe, and then feed that WAV to the Nero AAC encoder (http://www.nero.com/eng/technologies-aac-codec.html).
Casbar77
8th March 2011, 21:34
Get something like DGAVCIndex (http://neuron2.net/dgavcdecdi/dgavcdecdi.html) or DGDecNV (http://neuron2.net/dgdecnv/dgdecnv.html) and avisynth (http://avisynth.org/mediawiki/Main_Page). Simply speaking x264 looks for an uncompressed AVI input.
So what I'm missing is a frame server. Do I use DGAVCIndex or DGDecNV with or instead of avisynth? DGDecNV looks promising since I have a GTX 580.
For the audio I would recommend using eac3to to make a WAV, with the -down2 switch, and preferably -mixlfe, and then feed that WAV to the Nero AAC encoder (http://www.nero.com/eng/technologies-aac-codec.html).
That's what I did except I used FAAC for the encoder. Sorry for the confusion, it's been a month since I fooled with this. I'll make an edit to my original. Just out of curiosity, is Nero significantly better than FAAC, as you seem to prefer it?
ramicio
8th March 2011, 21:41
It gets used with avisynth. One could also use directshowsource() but DGDecNV is nice to offload the decoding to the GPU, and it's easier to for Blu-ray if you already stripped out the h.264 elementary stream (compared to trying to directshowsource() a multi-m2ts Blu-ray). Quicktime is supposed to be the best AAC codec out there, then Nero, then whatever else (in what order I have no idea.) I prefer using something free and easy rather than the best and installing a suite of Apple software, for one purpose. I usually just use quality-based encoding, too.
Casbar77
8th March 2011, 22:08
Ok so the next step is learning avisynth. So in theory, I could write an avi script to perform my entire workflow? Am I mistaken? I was originally planning on making this a batch file. Any suggestions?
sneaker_ger
8th March 2011, 22:11
You can use NeroAAC directly through eac3to without an intermediate wav: copy neroaacenc.exe to the eac3to folder and use "output.m4a" instead of "output.wav" in your command line.
If you want to continue using just handbrake (with the integrated faac) you could also make it much simpler:
1.) Use MakeMKV to copy/decrypt Blu-Ray to a .mkv-file
2.) Use Handbrake to encode it to mp4
Done.
Casbar77
8th March 2011, 22:22
You can use NeroAAC directly through eac3to without an intermediate wav: copy neroaacenc.exe to the eac3to folder and use "output.m4a" instead of "output.wav" in your command line.
If you want to continue using just handbrake (with the integrated faac) you could also make it much simpler:
1.) Use MakeMKV to copy/decrypt Blu-Ray to a .mkv-file
2.) Use Handbrake to encode it to mp4
Done.
Well Sneaker I'm trying to move beyond handbrake, so I'm actually trying to make it more complicated as kind of a learning thing. But thank you for the nero/eac3to tip; I'll make use of that.
ramicio
8th March 2011, 22:40
I've avoided the eacto with Nero thing anymore because half of the time it just crashes, mostly if from a matroska file. Avisynth is very easy to learn. All I ever use in an avisynth script is the source, maybe a deinterlacer, maybe a cropper, and maybe a resizer. As far as a batch file is concerned, I can't help ya there. I have all my stuff scripted in Perl.
Casbar77
13th March 2011, 02:54
Hey guys thanks for all the help so far. I installed avisynth and decided to just try to open my h264 file via avisynth using wmp. The directshowsource() decoder won't open the file type. I would like to see this work before I spend money on DGAVCIndex or DGDecNV.
In frustration I also tried opening the original .m2ts file, but it didn't work either.
This file is simply what eac3to demuxed from a .m2ts file
MediaInfo tells me this
General
Format : AVC
Format/Info : Advanced Video Codec
FileSize/String : 26.0 GiB
Video
Format : AVC
Format/Info : Advanced Video Codec
Format_Profile : High@L4.1
Format_Settings_CABAC/String : Yes
Format_Settings_RefFrames/String : 4 frames
BitRate_Mode/String : Variable
BitRate_Maximum/String : 32.0 Mbps
Width/String : 1 920 pixels
Height/String : 1 080 pixels
DisplayAspectRatio/String : 16:9
FrameRate/String : 23.976 fps
ColorSpace : YUV
ChromaSubsampling : 4:2:0
BitDepth/String : 8 bits
ScanType/String : Progressive
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
My avs script is just:
DirectShowSource("Filepath")
Any ideas?
Casbar77
13th March 2011, 03:23
Hey guys thanks for all the help so far. I installed avisynth and decided to just try to open my h264 file via avisynth using wmp. The directshowsource() decoder won't open the file type. I would like to see this work before I spend money on DGAVCIndex or DGDecNV.
Stupid question. Sorry.
:search::readfaq:
It looks like you must use DGAVCIndex or DGDecNV to decode raw h264 source material.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.