Public feed #527143

Mine

public text v1 · immutable
Raw Edit
·published 2007-06-01 05:44 UTC
rendered paste body
I'm going to outline the process I used to reencode HD-DVDs. If you don't know how to use these tools don't ask me how to use them as I don't have the time to teach people how to.

This method should work on more or less all titles.

You need:
Elecard MPEG-2 demultiplexer (part of their decoder package)
Sonic Cinemaster decoder (part of Sonic Scenarist) (if using VC-1 video)
demux.exe http://www.w6rz.net/evob_demux.zip (depreciated, only used for DTS audio demuxing)
EvoDemux
eac3toac3
virtualdubmod
avisynth 2.5.7
graphedit
a decent amount of disk space (30GB or so)

Directions:

1) Demux the movie evobs with EvoDemux GUI, latest version. You just need to demux the video stream and main DD+ audio stream. You will get a .mpv file for the movie and .mpa file for audio. The framecount value using the latest version of EvoDemux is apparently correct.

2) If the movie has DTSHD audio, demux it using the old demux.exe CLI interface as so:

demux PEVOB_1.EVO nul audio1.dts dtshd 1
demux PEVOB_2.EVO nul audio2.dts dtshd 1

This will give you two DTS files. I have found DTS demuxed using evodemux does not seem to play properly for some reason though I haven't tried it with the latest version.

If you have only DD+ audio, demux it with evodemux then use the eac3toac3 tool to convert it to ac3. This tool can be found in the evob demultiplexers thread on doom9.

3) Create a graph in graphedit with the mpv as your input. Go to graph > insert filters > directshow filters, add the elecard MPEG demultiplexer and the Sonic Cinemaster Video Decoder. Link the vc1 stream's output pin to elecard MPEG-2 demultiplexer, you will see a VC1 output pin appear on it. Elecard and Sonic demuxers are the only two directshow plugins which recognize VC1, but Sonic's gives an improper frame rate. Connect the VC1 output pin to the sonic cinemaster decoder input pin.

4) Figure out the framecount. EvoDemux's framecount value is essentially correct, or you can calculate the framecount by using the length of the AC3 audio that eac3toac3 creates.

5) Create the following avs:

directshowsource("movie.grf",audio=false,fps=23.976,seekzero=false,seek=true).trim(0,movie framecount)
converttoyv12()
crop(whatever your needed cropping values to remove letterboxing are)
your optional denoiser
spline36resize(whatever values you wish to resize to depending on the movie's AR)
your optional sharpener
your optional levels adjustment


Determine the cropping values by taking a screengrab of a bright scene in virtualdub and loading it in photoshop, then figuring out how many pixels worth of black borders there are to chop off on all sides. For anamorphic content use the following guideline to determine your resize value:

1920 x 784 - 796 = 1280 x 528 (2.42:1)
1920 x 796 - 808 = 1280 x 536 (2.38:1)
1920 x 808 - 832 = 1280 x 544 (2.35:1)

Some movies have slightly goofy aspect ratios (Oldboy is 1920 x 832). If so, go by the AR noted on the back of the movie's jacket.

6) Calculate the bitrate. The time length of the movie in minutes for bitrate calculation is framecount / 24 / 60. Use the demuxed DTS audio in your calculation, or if you transcoded the DTS to AC3 use that, or your DVD audio you're using, etc. Most of the time I aim for 1 1/2 DVD5 filesize if the movie's over 2h, and use either 1536K DTS or 640K AC3.

OPTIONAL) Transcode the DTS audio to AC3 using besweet/azidts or whatever tools, if you want to reencode to a DVD5 or don't feel there to be a need for 1.5mbps DTS. You can't put 1.5mbps DTS into a DVD5 without needlessly ditching video quality unless the movie's about 90 minutes or less. If you're doing a DVD9 you can just use the DTS.

7) encode with x264 using your usual commandline with the AVS as your source.

8) Optionally, create the following file and save it as time.txt, if you are using PAL audio:

# timecode format v1
assume 25

9) Mux in mkvmerge.

Select the encoded video. Under "general track options" is a "timecodes" field. Hit browse, pick time.txt if you are using PAL audio. You do not need to stretch/shrink the audio or use the timecodes file for any other tracks except the video.

Add your audio and subs. If you are using the DTS audio demuxed earlier, you add the first part, then append the second part to the first. The audio delay will usually be 0 if the audio is from the HD DVD, otherwise you will need to calculate the delay for DVD audio manually the same way you do when using DVD audio with a broadcast stream.

That's it.

The correct framerate for HD DVD is actually 23.976fps, not 24, I have determined this through working on several titles where the HD DVD audio only syncs to 23.976fps video, not 24. However, to get 23.976fps video which does not judder or skip frames, you have to use this method, running IVTC on the HD DVD output will result in frameskips.