Capturing & DVD encoding guide
Last update: 2008-03-13, fixed bad url to HC encoder website.
This guide describes how to capture from TV, VCR, Videocamera or any other video source, and how to properly convert the captured material to DVD. The manual only applies to the european PAL system.
Do you live in America? Then you'll have the NTSC system and won't be able to follow the exact instructions in this file. Most steps will still apply but not the talk about framerates and resolutions.
Anyway, if you're european and using the PAL system just follow the manual =)
The guide is meant for those who can't live with the limited configuration options offered by all-in-one packages such as the Ulead or Pinnacle software, and would like some more control of each step in the process. This guide will use some pretty advanced tools, but not to worry, you'll see its not that difficult if you just follow the instructions.
All the steps are written with a hands-on and practical approach. This means I didn't explain why I made every decision the way I did. For in-depth advanced tutorials, which for instance evaluate various ways to de-interlace, you should check out www.doom9.org
This guide is intended for:
- Hi8 to DVD
- Video8 to DVD
- HandyCam to DVD
- VHS to DVD
- TV to DVD
- VCR to DVD
- * to DVD ;)
The capturing part of the manual focuses on an S-Video or Composite video source.
Short summary of the steps we're going to take:
- Getting your WinXP installation ready
- Capturing video with VirtualDub
- Using AviSynth to frameserve the captured material
- Encoding with HC encoder (HCenc) to make captured material DVD compatible
- Rip the audiostream with VirtualDub
- Encode the audiostream with BeSweet GUI to DVD compatible format.
- Author the DVD with TMPGEnc DVD author 6.1
You might be asking yourself why we're going to use so many different tools? The answer is these are all high quality tools, specifically written for the taskwe'll use them for. Every single tool we're going to use, with the exception of TMPGEnc DVD Author is also freeware and often open source too.
The software zipfile
You can download all the tools needed for this guide from their official website, but you can also download my 6mb zipfile which has all tools already in it. The archive was created with the latest version of stuff on 2006-04-30. Click here to download the software zipfile. It's recommended to get this zipfile for use with this guide, as the options of the applications will differ if you're using different versions.
The guide often says something like "Now start BeSweetv1.5b31\BeSweetGUI.exe", this always is a file in this zipfile.
Tools in this zipfile:
=1= Getting your WinXP installation ready
- Installation of the capture card (optional)
(This only applies to people with a BT8x8 capture card, more info on this can be found at http://btwincap.sourceforge.net A list of compatible cards: http://btwincap.sourceforge.net/supportedcards.html)
To be able to capture in the best possible way, we need to install this custom capture card driver for cards with BT8x8 chipsets. Browse to Installers\btwdmdrvinstaller5.3.8 from my zipfile with all the needed tools in it. If you have such a capture card and run BtInstaller.exe inside this dir. Then just follow the installation procedure.
- Installation of the capture codec
Browse to Installers\huffyuv-2.1.1 in the zipfile
Right click huffyuv.inf and choose Install
- Installation of the AviSynth frameserver
Now we need to install the frameserver, what this tool does will be explained later. In explorer, go to Installers\Avisynth_256, run Avisynth_256.exe and follow the installation instructions.
=2= Capturing video with VirtualDub
In order to get the video on your computer, you'll need to capture it. I'll walk you trough the process on a step-by-step basis.
- Start VirtualDub-1.6.14\VirtualDub.exe from the zipfile
- File -> Capture AVI and VirtualDub will go from processing to capture mode
- File -> Set capture file. A "Save As" dialog will appear.
Check "Set this capture filename as the default"
Now choose a filename on a drive where you have plenty space free. (55gb for 90mins of captured video)
- Now we're back in the main capture screen. Click "Device" next to "File" and select your capture card in the device list.
For people who installed the btWincap drivers earlier, the device name will be "Conexant's BtPCI Capture (DirectShow)"
- Click Video->Preview
Click Video->Preview Acceleration->Both fields
- Click Video->Video source->Video Composite or S-Video.
(If you connected your cam to the pc with the yellow plug its Composite. If you're using the cable that looks like a mouse PS/2 plug, then its S-Video)
- Click Video->Capture filter
Select the appropriate PAL standard for your system. For me this is PAL_B as I live in the Netherlands, I don't know what it is for you.
If you don't know either, get the standard by partially running the btwincap installer again. In the step where you select a country, your standard is shown. When you see it just cancel the installation.
- Click Video->Set Custom Format
Select the number 720 in the first column, 576 in the second and YUY2 in the third. Then ok the dialog.
Note that this step is very important for the capture quality
- Now make sure the device you're going to capture from is hooked up to your capture card and press play. The video should now show up in the VirtualDub window. Are there borders with noise? Then we have to enable cropping. If there isn't any noise on the borders, skip this step.
Click Video->Cropping and a new dialog will appear. Increase the number textboxes until the noise has disappeared but WATCH OUT. You may ONLY crop by multiples of 4. So that's 4, 8, 12, 16 etc. If you use a number that's not a multiple of 4 you won't be able to finish this guide.
Click OK when done.
An image with noise on the borders which needs to be cropped: (removed the head for privacy reasons ;)
- If you're capturing from an analog video source like VHS, you probably need to enable noise reduction.
Click Video->Noise reduction->Enable
Click Video->Noise reduction->Threshold
Drag the slider all the way to the left and press the arrow button "right" on your keyboard 20 times. Then close the little dialog.
So much for the video configuration, now we're gonna setup the audio config!
- Make sure "Enable audio capture" is checked in the Audio menu (Right next to Video).
- Audio->Raw capture format, select "PCM: 44100Hz, stereo, 16-bit" and OK
- Audio->Compression, select "<No Compression (PCM)>" and OK
- Audio->Input Source->Line in (Assuming you have connected the audio to the line-in port of your soundcard (best solution))
- Audio->Audio Source->Audio Line
- Audio->Volume meter, and a volume meter will show up in the bottom of the screen.
Audio->Windows Mixer, keep this dialog open
Now play some parts on your video device with some loud noise in it, drag the slider on the windows mixer to a point where the 0dB mark isn't reached. On my system this slider is almost all the way down to the very first mark on the slider.
- Capture->Settings, set framerate to 25.0000 and OK
- Capture->Stop conditions
Check "capture time exceeds", uncheck the others.
Check how many minutes are on your tape or tv-program, add about 10mins to that, calculate how many seconds that is and fill that in.
So a 90min tape: 90min+10min=100min 100min*60secs=6000secs
These settings make sure the captured video will remain synced with the captured audio. In the past there were lots of VirtualDub mods which added this feature. As far as I can see you don't need those mods anymore as VirtualDub now supports this syncing from stock.
The default settings are ok here, or at least, they work just fine for me.
- Capture->Disk IO
If you're not sure what kindof buffer your harddisk has, just check "Disable windows write buffering" and OK the window.
If you know what your HDD buffer is, set "Chunks in buffer" to 2, and increase the "Chunk size" until the "Total buffer" value equals your HDD buffer.
- Capture->Capture Drives
Because AVI files can only be ~2gb large, the recorded stream will be split up in multiple AVI files. In this dialog you can configure where these files will go.
Click "Add spill drive", set priority to "+0" Threshold to "50Mb" and Path to the path where you selected the capture destination file in step 3.
For instance, in step 2 I saved my capture file as D:\WORKCAPTURE\capture.avi so my path is: D:\WORKCAPTURE
Set "Try not to create AVI files smaller than" to 50 megabytes
Set "Try not to create AVI files larger than" to 1900 megabytes
- Make sure that "Capture->Enable multisegment capture" is checked.
Now we're done configuring!
Rewind your tape or whatever, press play, now in virtualdub go Capture->Capture video to start capturing!
Pres escape to manually stop the capture.
- When capturing, make sure AMD Cool 'n Quiet features are disabled. CnQ is sure to cause lots of dropped frames. To disable go:
Configuration Panel->Power management. Select "Always On" and OK the window.
- It's always a good idea to capture ~5mins of video first to see if everything works ok, before leaving your system to capture for hours.
=3= Frameserving with AviSynth
In order to get the right format of video to the encoder, you'll need to frameserve it. I'll walk you trough the process on a step-by-step basis.
- Copy Misc\PAL.DVD.avs from the zipfile to the directory where your captured files are, these are the contents of the avs script.
# Put this script in the same dir as your captured files
# All sources go here
AviSource("capture.00.avi")+< I cut some text here so it displays nicely :) >+AviSource("capture.26.avi")
# If you captured, its likely you pressed the stop button 'too late'. A number of frames with no video will be on the end of the last avi file.
Change the third line with all the AviSource()'s on it to match your number of captured files.
# We're gonna trim these off here
# We're de-interlacing the captured video before applying any other filters!
# Bob() doubles the framerate, SelectOdd() brings it back down again.
# Resizing to PAL format
# Use bilinear resizing instead if you're shrinking instead of enlarging.
# Fadein/out from/to black on the start and end of the video.
# Fix audio sync, value depends on captured material.
# Fix audio loudness.
# Convert to YV12 so HCenc will accept it
Note that the last of the capture.XX.avi file is often like 11kB large. Don't add this one to the script, it's only a placeholder with no valid video data in it!!
Note: this script resizes your captured video to the PAL format. If you have cropped off a lot of pixels, this resize method might mess up the aspect ratio. Use PARanoia to generate a resizing script which adds black borders on the sides. As I only had to crop by a few pixels with my capture card, I'd rather have a video stretched with a few pixels than black borders along the sides.
- Fix audio sync
- Open VirtualDub-1.6.14\VirtualDub.exe in the zipfile
- File->Open Video File, select one of the avi files you have captured
- Press play and check if the audio is in sync with the video
- If not, go Audio->Interleaving and enter an audio skew correction until you get it right.
- Write down the delay value, write down 0 if the audio was already in sync
- Open up PAL.DVD.avs with notepad (you just copied this to the dir where your captured files are).
- Look for the line "DelayAudio(-0.15)". Replace -0.15 with the following number:
(The value you just wrote down * -1) / 1000
So if you wrote down a delay of 150ms, thats -0.15
if you wrote down a delay of 450ms, thats -0.45
if you wrote down a delay of 1500ms, thats -1,5
if you wrote down a delay of 0ms, then you dont need to fix the audio sync. Add the character # before DelayAudio.
the line should then look like "#DelayAudio(whatever)"
(If a # is the first character of the line, it will be ignored. It's called a comment)
- Save the notepad file.
- Fix video trimming,
If you captured, its likely you pressed the stop button 'too late'. A number of frames with no video will be on the end of the last avi file. We're gonna trim these off.
- Make sure the Trim() command in your .avs script is commented out so it looks like #Trim(whatever)
- Open VirtualDub-1.6.14\VirtualDub.exe
- File->Open Video File, select the PAL.DVD.avs file you just copied to the dir where your captured files are.
- Drag the time slider all the way to the right.
- Now start pressing the left button and you'll probably get a blue screen. This blue screen is what could be snow/noise on your TV when there is no signal. Find the last actual frame of the video with an image on it.
- In the bottom of the screen, it shows the current frame number and the time. Write this frame number and time down.
- Open up the PAL.DVD.avs in notepad, look for the #Trim() line.
- Remove the leading # character.
- If the frame number you wrote down was 123456, make sure the Trim() command looks like "Trim(0,123456)". Without the leading # char!!
- Save the file and open up the .avs file with Virtualdub again and see if it looks allright. The end should now be an image, not a blue screen like before!
If you get the error below while trying to open your .avs script:
#Message: "Could not decompress frame 0"
Then this can mean two things. You either have a file in your AviSource() list which has no video in it at all, or the first frame of the video file is actually bad. I only had this problem on one occasion. One of the .avi files had a bad first frame. To fix this problem, there are two solutions. The easiest solution is just capturing the entire video again. But there's a faster way too!
- Find bad file by shrinking the AviSources list down until no error is shown anymore.
- Rename the bad file to capture.bad.avi
- Open the bad file in virtualdub.
- Delete the leading bad frames.
- Video->direct stream copy
- Audio->direct stream copy
- File->Save as AVI to the original filename
Now open the original .avs script again and see if its fixed!
=4= Encoding with HCenc
Now we're going to convert the video to DVD compatible format. I'll walk you trough the process on a step-by-step basis. HC encoder is a very good CCE alternative. HC has some significant advantages over CCE. It's freeware and, on my system, a lot more stable (try googling for "cce crash"). I have compared the encoding results with other software like ULead, TMPGEnc, QuEnc *and* CCE. It suprised me the free HC encoder came up with the best results every time, and also the fastest encoding time!
We're going to assume 192kbps audio
- Bitrate calculation
Go to http://www.videohelp.com/calc.htm
In the previous step "Frameserving" we wrote down how many hours and minutes our video takes. Enter this amount of time in the calc tool.
Now select audio bitrate 192kbit/s
Now press the "Advanced mode" button and change the 4480MB value to something like 4400. We're doing this because we need to keep some free space for the DVD Menu later on.
Write down the calculated bitrate and the DVD Max bitrate.
Now start HC018\HCgui_018.exe from the zipfile
Select the PAL.DVD.avs file you copied to the dir where the captured files are as input file.
Choose an output file, this will be the encoded mpeg file for the DVD.
Choose a logfile.
Check the bitrate-average bitrate radiobutton.
For average (kb/s) fill in the calculated bitrate you wrote down earlier (step 1)
For maximum (kb/s) fill in the max bitrate you wrote down earlier (step 1)
- Encoding quality
Select encoding profile "normal", or higher if you have plenty time to spare. The ideal option would of course be 'best'. On my AMD 64 3200+ it takes a little over 5 hours, to encode 90mins of video with 'best' checked.
- Aspect ratio
Select 4:3 (Assuming you didnt capture in widescreen resolution)
Make sure interlaced is UNchecked (as in blank),
These ones should be checked: scene change, autogop, VBV check, seq encode
Click "All frames" button to make sure HCenc will process all frames.
- Hit the "Make DVD compliant" button (just to be sure).
- Click the "save HC.ini" button, so you wont have to enter all these settings again the next time.
Leave all other settings as default, your HCenc screen should now look something like this:
- Click the encode button, and have a lot of patience
- When encoding is done, run GSpot\GSpot.exe from the zipfile
- File->Open, select m2v/mpeg file you just encoded, check if it says dvd compliant
If so, we're done encoding the video.
You now have encoded the video file. There indeed is no sound yet when you play it, that's the next step!
=5= Ripping the audio from the captured files
- Open VirtualDub-1.6.14\VirtualDub.exe from the zipfile
- Open the PAL.DVD.avs file you copied to the dir where the captured files are as input file.
- Audio->Full Processing Mode
- Audio->Conversion, select 84000 Hz and OK
- File->Save WAV
- Have some patience
=6= Encoding the audio with BeSweet
- Open BeSweetv1.5b31\BeSweetGUI.exe from the zipfile
- Choose Wizard mode and press GO
- Drag the WAV file you just saved in the dialog, then click Next
- Select MP2
- Choose Mono or Stereo, click Next
- Choose 192 bitrate in the list, and "None" in the FRC Presets, Click Next
- Click GO (this will take much less time than encoding the video part).
BeSweet will now encode a DVD compatible audio file which we can use in our DVD Author program!
The encoded file will be saved in the same dir as where the WAV file is.
=7= Authoring the DVD
In this step we'll be combining the video and audio, and put it on a dvd with a nice menu.
This step is written for TMPGEnc DVD Author v1.6. This program is available as trial, but not included in my zipfile. You can download it here.
Adding the files
- Start TMPGEnc DVD Author. (Im using version 1.6)
- Click "Create New Project"
- Click "Add File", select the video file you encoded with HCenc (the m2v file)
- Select the Audio file BeSweet just encoded
- Now press the "Chapter cut edit" button
- Drag the horizontal slider to the points where you want the first chapter cut to be you can also use the arrow buttons.
- Press the "Add current frame to chapter button"
- Repeat step 6 & 7 till you're done.
- Hit OK
- Hit the settings button in the left column
Change the title to what you would consider to be the general title for all of the video you just encoded
(This is all just the way I did it, you can decide about your own approach.)
- Hit Menu Display Settings
Select "Only track menu"
Firstplay action: Display Main Menu
Action to take after each track has been played: Display Main Menu
- Change chapter thumbs by clicking the thumbnails in the preview windows
- I really dont think I have to explain more things as its all pretty easy to use
Sponsors: Lasersnijden, Foliestaalplaat voor daktoepassingen, Rhino aanrijdbeveiligingen, Sneeuwschep, Tuinscherm, Kantopsluiting, Outdoorable, Arancio Spritz, The orange drink with pride