QuEnc Guide
What's QuEnc? Another one of Nic's pet projects. Based on ffmpeg, QuEnc is an easy to use MPEG-2 encoder that is completely free, yet yields amazingly good quality (no, it doesn't beat CCE SP, but there's a $1900 price difference between the two). It's also quite fast for an MPEG-2 encoder, but since it's a full encoder, not a compressed domain transcoder, you won't get your DVDs done in 20 minutes. QuEnc, being a very simple program, only supports AviSynth input. But since many people use AviSynth anyway, that's not really a problem, is it? And if it is, you'll learn how to tackle it in this guide.
You'll need the following software in this guide
QuEnc
AviSynth
DVD2AVI (if your
source is MPEG-2)
Step 1: Create a DVD2AVI project
DVD2AVI allows you to frameserve a video file into another application that cannot open MPEG-2 files natively. Now create a DVD2AVI project for later frameserving.
Step 2: Create an AviSynth script
If you've never created an AviSynth script, and the word script scares you, don't be afraid, it's easier than you think. The first thing to do is open up Notepad. Then copy and paste the following two lines:
LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec3.dll")
mpeg2source("D:\DVDs\movie.d2v")
This is a basic script that frameserves your DVD2AVI project to an application opening the AviSynth script. Save this file as movie.avs, and open it in your media player. Sure enough, you'll watch your movie, just without audio. If it doesn't work, the path in the first line is probably not correct. It should point to the MPEG2Dec3dg.dll file that comes with AviSynth.
In case you have to perform IVTC (you found that out in the DVD2AVI step), you'll need a more complex AviSynth script involving decomb. You can read all about Decomb here. And make sure you remove any Resize line from the script when you get back!
Until now I've assumed your source had DVD resolution (720x480 for NTSC, 720x576 for PAL). If this is not the case, let's stretch the video to the proper resolution, shall we. If we're dealing with a non DVD resolution DVB stream, it will still have the proper vertical resolution, so all we have to do is stretch it horizontally. You can do this by adding the following line at the end of your AviSynth script:
BicubicResize(720,480,0,0.5)
Replace 480 by 576 if your source is PAL.
And what if your source is an AVI? Then the AviSynth script will look completely different. It'll start with
AviSource("c:\movies\somemovie.avi")
But that's not all. Your AVI will most likely not have DVD resolution so we have to stretch it.
Step 3: Encode
If you start up QuEnc, you might feel a little off track. The reddish look is not everybody's thing, but you can change that by pressing the Advanced Options button right away.
To
change the look, change the 4 colors under GUI Appearance (it requires
HTML style RGB hexadecimal colors), or press the Grey button (imho it
looks much better in grey). Then let's start the real work.
Force Closed GOP should not be used unless you're encoding content for a multiangle DVD (and only the multiangle bits would require that option). Keep the GOP Size at 12 (DVD standard).
Keep KVCD "Notch" Matrix unchecked (unless you feel daring - everything that has an X != S before VCD is sort of suspect to me), and keep the Max B-Frames at 2 (our champion CCE SP does it like that, and they CCE makers know what they're doing).
Then we have the aspect ratio. If your source is a 16:9 DVD, keep this at 16:9 Aspect Ratio, otherwise set it to 4:3 Aspect Ratio.
Then press Apply to get back to the main window.
The
first thing you'll have to do here is select the Source AVS File. Press
the ... button and select your AviSynth script. No, once again, AVI input
is not possible! The Destination M2V File will automatically be filled
in, using the same path and name as the source file but you can obviously change
that if you like.
Then check MPEG-2 if it's not already checked. Set the Bitrate to your desired bitrate. If you haven't calculated the bitrate yet, here's a quick and dirty way how to do it: 9800 - total audio bitrate. As an example if you have 1 2.0 kbit/s AC3 track (192kbit/s), 2 5.1 kbit/s AC3 tracks (384kbit/s each) you'd get to a max bitrate of 9800 - 192 - 2*384 = 8840 kbit/s. If you're wondering what bitrate a certain audio track has you can use a software DVD player and activate the information screen they usually have.
Check Use VBR (otherwise the video will have a constant bitrate - not a good thing for what we're doing), as well as High Quality.
Use Trellis Quant can also help improve quality, but slows down encoding. Finally, check 2 Pass Encoding to perform two encoding passes.
Now all that remains to be done is press Encode.
Step 4 Audio encoding (AVI input only)
TBD: Audio extraction using VDub & encoding using BeSweet.
Step 5: Authoring
Now you can use whichever tool you prefer to author your DVD.
This document was last updated on April 14, 2004