View Full Version : Nice 720p->DVD using avisynth

06-21-2006, 08:16 AM
Just wanted to share some nice results I had converting a video to DVD, and how I did it. NOTE: I cannot take credit for most of the avisynth steps, as they were given to me by the kind folks over at the doom9 forums.

Anyway. Video: 2 episodes (actually both part of a 2-parter) of Enterprise. Tivo'd via an HR10-250 off of a local station (OTA).

The weird bit: the episodes were broadcast at 720/60p...but this was not the HD version of Enterprise. Instead they took the SD 4:3 480/30i version of Enterprise (with letterboxing), added hard pillarboxing to make it 16:9 and upconverted it to 720/60p. So the videos end up inside a black rectangle. Also, the audio presented as DD5.1 but it really wasn't -- dialog was in the FL and FR speakers, etc.

So I pulled them down via TyTool. TyTool biffed trying to multiplex them, so I used hdemux/mplex to turn them into MPGs, and edited commercials with VideoReDo. Opened the edited MPG files in DGDecode and saved the d2v projects (along with the .ac3 audio). I then used this avisynth script:

msharpen(threshold=20) (comment: broadcast video was rather soft)
selecteven() (comment: to remove dupe frames caused by conversion to 60 progressive fps)
Crop(160,90,-160,-90) (comment: to remove the letterbox/pillarbox)
LanczosResize(704,480) (comment: down to dvd resolution)
tdecimate() (comment: bring down to 23.976 fps film)
BT709ToBT601() (comment: convert HD to SD colorspace)
I then fired up Canopus ProCoder (but you could use most any MPG encoder). I told it to encode to DVD, set the aspect flag to 16:9, and set the framerate to 23.976 w/pulldown.

Then I pulled the encoded .m2v files along with the .ac3 files into DVD-Lab. Unfortunately the result was just a tad too big for a DVD-5. Given that the audio really wasn't 5.1 surround, I transcoded the audio to mpa and everything fit fine. I ended up with a nice, anamorphic DVD that looks fabulous.

Note: be careful with msharpen! Preview it in VDub to make sure you aren't oversharpening. As it is I ended up with a slight bit of edge enhancement, but it's minor and the sharpening was worth it. However, it would be very easy to overdo this, so check each video individually. You can check exactly what's going to be sharpened by changing the msharpen entry in avisynth to this:

msharpen(threshold=20,mask=true)Open it up in vdub and you'll see green screens with bright highlights showing where the sharpening will be. Tweak the threshold parameter (and the strength parameter) until you get the sharpening you want while maintaining a natural look.

06-26-2006, 01:52 PM

Very clear step by step instruction. I'm in the process of archiving some HD clip from DTV through my HR10-250 as well. Have you done any actual HD clips yet? The clips I got are about 13-14GB for 2-3 hrs. How much time does it take your computer to process one clip?