Log in

View Full Version : Please review: HDTV to DVD conversion


eswrite
30th May 2007, 16:16
I finally have some time (lots of it, as it turns out) to do some HDTV to DVD conversion. I am doing the following, and would like others to review and see if I'm missing anything.

1) I am taking 1080i .ts file captured with MyHD and using DGIndex to demux video & audio. More specifically, I am demuxing in segments, to also accomplish commercial removal, so that at the end of this process, I have 15 video/audio segments. I think this also helps with audio sync'ing, since as it turns out, each segment has its one delay.

2) Then, I use the .avs code listed below to process each segment, and use QuEnc/AviSynth in batch mode (very cool) to process all segments. Note:
a) I am decimating, then using QuEnc's pulldown feature (yes!) -- failure to do this yields choppy video in moderately to fast movement sections.
b) I am using a minimum bit rate of 4500 and maximum of 9000 (using QuEnc's default of 9800 yielded bitrates in excess of 10000, which TmpEnc choked at).
c) As a last step, I use TmpgEnc DVD Author to bring in the MPEG2 files generaged by QuEnc/AviSynth (I also have TmpgEnc Editor, but haven't gotten much out of it, since it couldn't mux DGIndex's output).

Comments & suggestions welcomed.


##################################################################################
##
## Script: i_hdmux2dvd.avs
##
## Description: HD to DVD conversion from DGIndex de-muxed video & audio.
##
##################################################################################
LoadPlugin("C:\Program Files\Video Tools\DGIndex\DGDecode.dll")
LoadPlugin("C:\Program Files\Video Tools\VDubMod\AviSynth 2.5\plugins\NicAudio.dll")

function mux2dvd(string mpg_src, string audio_src, float audio_dly)
{
### Load HDTV video
vhd=MPEG2Source(mpg_src) # <== replace with your .d2v file name [1]
srcHeight=vhd.height()
is720p = srcHeight < 800 ? true : false

###-Test: shows threshold at 25; above it, interlaced frames show up
#return Video.Telecide(order=1, guide=1, post=3, vthresh=25, show=true)

### Use NicAC3Source for AC3 file: replace file name from your .ac3 file [2]
#ahd = DirectShowSource (audio_src, video = false)
ahd = NicAC3Source(audio_src)

AudioDub(vhd,ahd)
DelayAudio(audio_dly) # <== set value from 'DELAY' in sound file name (DELAY/1000) [3]

### For Source AR of 1.778:1 -- 16:9 Wide-Ssreen
#-Apply IVTC for telecined source
vt=Telecide(order=1, guide=1, post=2, vthresh=25)
#-Select every other frame when input is 720p
vs = is720p ? vt.SelectEven() : vt
vs.Decimate(cycle=5) # for 24fps

#-Resize to DVD resolution
v_out = Lanczos4Resize(720,480)#.Subtitle(is720p ? "720p" : "1080i")

### Output is at 24 fps: must do pulldown post-process (i.e., DGPulldown)
#-For DVD creation need 29.97fps interlaced
return v_out
}

#############################################################
# File: hdtv_mux-resize_01.avs
# Sample for .avs using above script: processing "National Treasure" .ts from
# MyHD capture.

Import("C:\Program Files\Video Tools\VDubMod\include\i_hdmux2dvd.avs")

v_out = mux2dvd("D:\Our Videos\National Treasure\Demuxed\0520-2000_00-01.d2v", "D:\Our Videos\National Treasure\Demuxed\0520-2000_00-01 PID 034 T01 3_2ch 384Kbps DELAY -431ms.ac3", -0.431) # <== set value from 'DELAY' in sound file name (DELAY/1000)

### Output is at 24 fps: must do pulldown post-process (i.e., DGPulldown)
#-For DVD creation need 29.97fps interlaced
return v_out

REM #############################################################
REM ## File: mux2mpg.bat
REM ## Batch file to run QuEnc against the 15 comercial-less segments I generated
REM ## using DGIndex...

"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_01.avs -o "D:\Our Videos\National Treasure\Processed\nt01.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_02.avs -o "D:\Our Videos\National Treasure\Processed\nt02.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_03.avs -o "D:\Our Videos\National Treasure\Processed\nt03.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_04.avs -o "D:\Our Videos\National Treasure\Processed\nt04.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_05.avs -o "D:\Our Videos\National Treasure\Processed\nt05.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_06.avs -o "D:\Our Videos\National Treasure\Processed\nt06.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_07.avs -o "D:\Our Videos\National Treasure\Processed\nt07.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_08.avs -o "D:\Our Videos\National Treasure\Processed\nt08.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_09.avs -o "D:\Our Videos\National Treasure\Processed\nt09.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_10.avs -o "D:\Our Videos\National Treasure\Processed\nt10.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_11.avs -o "D:\Our Videos\National Treasure\Processed\nt11.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_12.avs -o "D:\Our Videos\National Treasure\Processed\nt12.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_13.avs -o "D:\Our Videos\National Treasure\Processed\nt13.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_14.avs -o "D:\Our Videos\National Treasure\Processed\nt14.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close
"C:\Program Files\Video Tools\VDubMod\QuEnc" -i hdtv_mux-resize_15.avs -o "D:\Our Videos\National Treasure\Processed\nt15.mpg" -b 4500 -maxbitrate 9000 -hq -audiocodec ac3 -audiobitrate 256 -auto -close

Boulder
30th May 2007, 20:50
I'd switch to using TIVTC (TFM+TDecimate) instead of Telecide and Decimate. Not that Decomb is bad but I think that TIVTC is faster. I'd also leave the minimum bitrate to something like 150-300kbps.