bb
29th August 2003, 16:41
The guide is available with pictures here:
http://www.doom9.org/dv/guide.html
The following guide is a basic document with the goal of providing assistance for the first steps in DVD creation using DV sources.
Software needed to follow this guide:
- DV editing program
- AviSynth
- BeSweet
- CinemaCraft Encoder (CCE), TMPGEnc, or MainConcept MPEG Encoder
- DVD authoring program
1. Cutting, Editing, Transitions, etc.
The first step in DVD creation is the most creative part of editing the video. This can be done by using a variety of basic DV editing programs like Ulead VideoStudio, MGI VideoWave, Pinnacle Studio, or with one of the professional programs, e.g. Adobe Premiere, Ulead MediaStudio Pro, or SonicFoundry Vegas Video. The large variety of editing programs and the different editing options they offer would easily exceed the target of this guide. So capture your DV file from your camcorder, and edit it as you like according to your creativeness.
Save the DV file, either as a type-1 or as a type-2 AVI. Save the audio separately to a WAV file (your DV editing program should support this somewhere).
2. Encoding the audio
You have the choice to use either AC3 (Dolby Digital 2.0) or MP2 as sound format. Check out if your DVD authoring software supports AC3; if not, you have to use MP2. My preferred authoring program is DVDlab, which supports AC3. Use BeSweet to convert your WAV file. There is a BeSweet GUI available, which you can use for MP2 encoding; for AC3 I prefer AC3Machine, which is a BeSweet GUI, too, but focussed on AC3 encoding.
2.1 MP2 encoding
Start the BeSweet GUI, and click on the "2Lame" button on the right. Select the WAV file you extracted in step 1 above, and select path and filename for the resulting MP2 file. If your source is not 48 kHz, then check "Sample Rate" in the "Input Options" box, and set the value to 48. In the "Output options" box set "Encoding Mode" to stereo, and set the "Total Bitrate" to your likings, 224 kbps is recommended. Then click the "WAV to MP2" button, and your MP2 file will be created.
2.2 AC3 encoding
Start AC3Machine, select the extracted WAV file as "Input (AC3)", and select a path / filename for "Output (AC3)". Set "LFE ToLR Channels" to -3db, set the "Channels Mode" to stereo, uncheck "Dynamic Compression", and check "Auto Find Maximum Gain". Set the delay to 0 msecs. If your source WAV is not sampled at 48kHz, then check "Set Sampling Rate to 48000 Hz" in the SSRC Options box. Choose your bitrate: 224 kbps is recommended. Then click on "Give me AC3!" and wait until the process is finished.
3. Encoding the video
DVDs use MPEG-2 as the video format. There are several good encoders available, e.g. the Cinemacraft Encoder (CCE), TMPGEnc, Canopus Procoder, MainConcept MPEG Encoder, and a few more. In this guide I'll focus on CCE 2.66, TMPGEnc 2.5, Canopus Procoder 1.5, and on MainConcept MPEG Encoder 1.4.2.
If you aim for a specific size, you need to calculate the video bitrate first. I suggest to convert all file sizes to Megabytes, so that you don't get confused. We start with the size available. Let's say you want to fill a whole DVD-R, so the size available is 4.38 GB or 4485 MB. Subtract the size of your audio file (in MB), e.g. 167 MB; so the space available for the video is 4485 MB - 167 MB = 4319 MB. Calculate the duration of the video in seconds, e.g. if the video is 1h 44min 10sec, the total in secs is 6250. So the video bitrate should not exceed 4319 * 1024 * 8 / 6250 kbps = 5660 kbps. Because there's some muxing overhead, and you probably want to add menues and chapters, you should get lower than that, so in the example above I'd use an average bitrate of 5500 kbps.
3.1 CCE
3.1.1 Create an AviSynth script
The way you write your AviSynth script depends on the source and on your personal taste. Here are examples to start with; of course you may change filter settings, use different filters, etc.:
Progressive DV
AviSource("C:\MyDVFiles\DV_type2_file.avi")
Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
or
DirectShowSource("C:\MyDVFiles\DV_type1_file.avi", 25)
Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
(the 25 above is the frame rate for PAL; for NTSC you'd use 30.)
Interlaced DV
AviSource("C:\MyDVFiles\DV_type2_file.avi")
SeparateFields()
odd=SelectOdd.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
DoubleWeave.SelectOdd()
This way each field will be filtered separately, thus the interlaced structure will be preserved. Replace AviSource with DirectShowSource like above if your DV AVI is type-1.
NTSC issues
As NTSC DV uses 4:1:1 colorspace there's an issue with the conversion to the 4:2:0 colorspace used in DVD MPEG-2. To address this issue use trbarry's filter ReInterpolate411().
To get improved color conversion, simply add a
ReInterpolate411()
command below the AviSource or DirectShowSource command, respectively.
3.1.2 EclCCE
EclCCE is a nice tool provided by RB, which extends CCE's capabilities, e.g. it enables the CCE trial version of saving ECL (project settings) files. But the addition I like best is the integration of a shutdown checkbox, so that you can shutdown your computer after the encoding finishes.
3.1.3 CCE settings
Start EclCCE (or CCE directly). Open the AVS file you created in 3.1.1 by right-clicking the CCE window and selecting "Add". The AVS appears in the CCE window. Double-click the new entry to change the encoding settings.
You can use "MPEG-2 (ES, One-pass VBR)" if the video you want to encode is not very long, you don't neet to meet a given size exactly, and you want to save time during encoding. In this case select a Q factor of 60 or less - I often use 40.
Usually you'll want to have a predictable size with the best quality possible. You'll choose "MPEG-2 (ES, Multipass VBR)", set the calculated bitrate as average, and set minimum and maximum bitrate to 2000 and 8500 respectively. Use at least 2 passes; 3 passes is even better, but more is useless.
Set the correct aspect ratio, 4:3 for most DV sources, 16:9 if you recorded in 16:9 mode. Don't process the audio in CCE (we will use BeSweet for better quality).
In the Video settings select "DVD video compliant", and uncheck the "Upper field first" box (field order correction done in AviSynth script).
In the menu you get when clicking the "Quality" button, unselect "Low pass filter", "Effect restricted vertical filter", and "Dithered quantization". I leave the flat part priority at the default of 16. Set "Intra block DC precision" to 9 or 10 Bits. For interlaced sources select "Block scanning order" = "Alternate". For progressive sources select "Zigzag" and check "Progressive frame flag".
3.2 TMPGEnc
It is really easy to use TMPGEnc for DV to DVD conversions. Start the encoder, cancel the wizard (if applicable), and open your DV type-1 or type-2 file via the "Browse" button next to the "Video source" field. Your AVI file will automatically be entered in the "Audio source" field, too, and an "Output file name" will be suggested.
We are going to create elementary streams as input for a DVD authoring program. In the "Stream type" box select "ES Video+Audio", if you want to create an MP2 file in TMPGEnc (skipping the BeSweet step above). Else select "ES Video only" (MP2 or AC3 created by BeSweet). Click the "Load" button, and open a template, either "DVD (PAL).mcf" or "DVD (NTSC).mcf".
Click on the "Setting" button to make further adjustments. Because you loaded a template, many options are greyed out. If you'd like to change these for some reason, load the template "unlock.mcf", which you will find in the subdirectory "Extra". In this guide we won't need that.
Let's have a look at the "Video" tab first. You may leave the "Rate control mode" settings to the defaults (Constant Quality, quality factor 65, min. bitrate 2000 kbps, max. bitrate 8000 kbps). If you need to fit a certain size, select "2-pass VBR(VBR)", and click the "Setting" button next to the rate control mode. Adjust the "Average bitrate" to your needs.
The "Encode mode" should be set according to your source material. If it's interlaced, select "Interlace"; if it's progressive, select "Non-interlace".
Leave the "DC component precision" at "9 bits", or set it to "10 bits".
The "Motion search precision" has a large impact on the final quality, but on the processing time consumed, too. "Motion estimate search (fast)" is a good compromise between quality and speed. If you want the best quality possible, select "High quality (slow)" or even "Highest quality (very slow)". But be warned: your encoding can take many hours!
Move over to the "Advanced" tab. Set "Video source type" according to your source (should be the same as "Encode mode" on the "Video" tab).
The "Field order" is for interlaced sources only. DV should be "Bottom field first (field B)", unless you have a strange source...
Under "Source aspect ratio" select one of the 4:3 or 16:9 settings, depending on your source again. E.g. I use "16:9 625 line (PAL)" for my 16:9 recordings, and "4:3 625 line (PAL)" for my 4:3 recordings.
Select "Full screen (keep aspect ratio)" as the "Video arrange Method".
You may activate filters here, too. I'll leave this topic to your experiments.
As we won't make changes to the GOP structure or the quantize matrices, skip to the "Audio" tab (which is not present if you selected stream type "ES (Video only)"). You may change the audio bitrate here, if you want to let TMPGEnc create the MP2 file.
Confirm the tabbed dialog by clicking the "OK" button, then click on "Start" in the upper left and wait until TMPGEnc is finished.
3.3 Canopus ProCoder
Start ProCoder. On the "Source" tab, add the DV file you want to encode. Once the file is opened, you'll see the "Source Parameters" on the right, containing information about the video and the audio. The only thing you may want to change here is the "Aspect Ratio" setting, which defaults to "4 x 3", but has to be changed into "16 x 9" for 16:9 sources.
Switch to the "Target" tab, and click the "Add" button. The "Add Target" dialog box opens, and you continue on its "VCD/DVD" tab. Select the appropriate template, either "MPEG2 - DVD PAL", or "MPEG2 - DVD NTSC". Confirm by clicking "OK".
The "Target Parameters" contain all the settings you can change before starting the conversion. First you may want to change the "Base Name" and the "Path", which specify filenames and location of your output files (video and audio). Under "Stream Type", make sure "MPEG2 Video + Wave file" is selected.
"Interlacing" will usually stay on "Lower/Odd field first", unless your source is progressive. In that case select "Non-Interlaced". Choose "4:3" or "16:9" for "Video Aspect Ratio", depending on whether you shot your DV in 4:3 or 16:9 mode. And there's the "Pixel Aspect Ratio" setting, which has to be set to "D1/...", either PAL or NTSC, either 4:3 or 16:9.
Under "Speed/Quality" you may select "Highest Quality". If you don't care for processing time at all, "Mastering Quality" may give slightly better results.
"CBR/VBR Type" should be set to either "VBR 1-pass" or "VBR 2-pass". The latter needs twice the encoding time, but you'll get closer to the specified bitrate, and thus your filesize will be predictable. For the same (average) bitrate "VBR 2-pass" reaches better quality. There are two video bitrates to be set: "Video Bitrate(kbps)" is the average bitrate you calculated at the top of step 3., whereas "Max. bitrate(kbps)" specifies the limit for the encoder. Set that one to 8000.
There are a lot more options available when you click the "Advanced" button, and you can add video and audio filters. As a beginner you can safely leave everything to the defaults here, but of course feel invited to experiment! E.g. if you recordet at 24 fps, you'll need to add a "Video Pulldown" filter.
Now you may want to save your profile ;-) You can create so-called droplets, too, but you have to find out yourself how to do that :-)
Finally switch to the "Convert" tab, and take a cup of coffee. You should end up with an m2v video file (MPEG-2 elementary stream) and a wav audio file.
Special thanks to Dali Lama for the inspiration!
http://www.doom9.org/dv/guide.html
The following guide is a basic document with the goal of providing assistance for the first steps in DVD creation using DV sources.
Software needed to follow this guide:
- DV editing program
- AviSynth
- BeSweet
- CinemaCraft Encoder (CCE), TMPGEnc, or MainConcept MPEG Encoder
- DVD authoring program
1. Cutting, Editing, Transitions, etc.
The first step in DVD creation is the most creative part of editing the video. This can be done by using a variety of basic DV editing programs like Ulead VideoStudio, MGI VideoWave, Pinnacle Studio, or with one of the professional programs, e.g. Adobe Premiere, Ulead MediaStudio Pro, or SonicFoundry Vegas Video. The large variety of editing programs and the different editing options they offer would easily exceed the target of this guide. So capture your DV file from your camcorder, and edit it as you like according to your creativeness.
Save the DV file, either as a type-1 or as a type-2 AVI. Save the audio separately to a WAV file (your DV editing program should support this somewhere).
2. Encoding the audio
You have the choice to use either AC3 (Dolby Digital 2.0) or MP2 as sound format. Check out if your DVD authoring software supports AC3; if not, you have to use MP2. My preferred authoring program is DVDlab, which supports AC3. Use BeSweet to convert your WAV file. There is a BeSweet GUI available, which you can use for MP2 encoding; for AC3 I prefer AC3Machine, which is a BeSweet GUI, too, but focussed on AC3 encoding.
2.1 MP2 encoding
Start the BeSweet GUI, and click on the "2Lame" button on the right. Select the WAV file you extracted in step 1 above, and select path and filename for the resulting MP2 file. If your source is not 48 kHz, then check "Sample Rate" in the "Input Options" box, and set the value to 48. In the "Output options" box set "Encoding Mode" to stereo, and set the "Total Bitrate" to your likings, 224 kbps is recommended. Then click the "WAV to MP2" button, and your MP2 file will be created.
2.2 AC3 encoding
Start AC3Machine, select the extracted WAV file as "Input (AC3)", and select a path / filename for "Output (AC3)". Set "LFE ToLR Channels" to -3db, set the "Channels Mode" to stereo, uncheck "Dynamic Compression", and check "Auto Find Maximum Gain". Set the delay to 0 msecs. If your source WAV is not sampled at 48kHz, then check "Set Sampling Rate to 48000 Hz" in the SSRC Options box. Choose your bitrate: 224 kbps is recommended. Then click on "Give me AC3!" and wait until the process is finished.
3. Encoding the video
DVDs use MPEG-2 as the video format. There are several good encoders available, e.g. the Cinemacraft Encoder (CCE), TMPGEnc, Canopus Procoder, MainConcept MPEG Encoder, and a few more. In this guide I'll focus on CCE 2.66, TMPGEnc 2.5, Canopus Procoder 1.5, and on MainConcept MPEG Encoder 1.4.2.
If you aim for a specific size, you need to calculate the video bitrate first. I suggest to convert all file sizes to Megabytes, so that you don't get confused. We start with the size available. Let's say you want to fill a whole DVD-R, so the size available is 4.38 GB or 4485 MB. Subtract the size of your audio file (in MB), e.g. 167 MB; so the space available for the video is 4485 MB - 167 MB = 4319 MB. Calculate the duration of the video in seconds, e.g. if the video is 1h 44min 10sec, the total in secs is 6250. So the video bitrate should not exceed 4319 * 1024 * 8 / 6250 kbps = 5660 kbps. Because there's some muxing overhead, and you probably want to add menues and chapters, you should get lower than that, so in the example above I'd use an average bitrate of 5500 kbps.
3.1 CCE
3.1.1 Create an AviSynth script
The way you write your AviSynth script depends on the source and on your personal taste. Here are examples to start with; of course you may change filter settings, use different filters, etc.:
Progressive DV
AviSource("C:\MyDVFiles\DV_type2_file.avi")
Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
or
DirectShowSource("C:\MyDVFiles\DV_type1_file.avi", 25)
Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
(the 25 above is the frame rate for PAL; for NTSC you'd use 30.)
Interlaced DV
AviSource("C:\MyDVFiles\DV_type2_file.avi")
SeparateFields()
odd=SelectOdd.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
DoubleWeave.SelectOdd()
This way each field will be filtered separately, thus the interlaced structure will be preserved. Replace AviSource with DirectShowSource like above if your DV AVI is type-1.
NTSC issues
As NTSC DV uses 4:1:1 colorspace there's an issue with the conversion to the 4:2:0 colorspace used in DVD MPEG-2. To address this issue use trbarry's filter ReInterpolate411().
To get improved color conversion, simply add a
ReInterpolate411()
command below the AviSource or DirectShowSource command, respectively.
3.1.2 EclCCE
EclCCE is a nice tool provided by RB, which extends CCE's capabilities, e.g. it enables the CCE trial version of saving ECL (project settings) files. But the addition I like best is the integration of a shutdown checkbox, so that you can shutdown your computer after the encoding finishes.
3.1.3 CCE settings
Start EclCCE (or CCE directly). Open the AVS file you created in 3.1.1 by right-clicking the CCE window and selecting "Add". The AVS appears in the CCE window. Double-click the new entry to change the encoding settings.
You can use "MPEG-2 (ES, One-pass VBR)" if the video you want to encode is not very long, you don't neet to meet a given size exactly, and you want to save time during encoding. In this case select a Q factor of 60 or less - I often use 40.
Usually you'll want to have a predictable size with the best quality possible. You'll choose "MPEG-2 (ES, Multipass VBR)", set the calculated bitrate as average, and set minimum and maximum bitrate to 2000 and 8500 respectively. Use at least 2 passes; 3 passes is even better, but more is useless.
Set the correct aspect ratio, 4:3 for most DV sources, 16:9 if you recorded in 16:9 mode. Don't process the audio in CCE (we will use BeSweet for better quality).
In the Video settings select "DVD video compliant", and uncheck the "Upper field first" box (field order correction done in AviSynth script).
In the menu you get when clicking the "Quality" button, unselect "Low pass filter", "Effect restricted vertical filter", and "Dithered quantization". I leave the flat part priority at the default of 16. Set "Intra block DC precision" to 9 or 10 Bits. For interlaced sources select "Block scanning order" = "Alternate". For progressive sources select "Zigzag" and check "Progressive frame flag".
3.2 TMPGEnc
It is really easy to use TMPGEnc for DV to DVD conversions. Start the encoder, cancel the wizard (if applicable), and open your DV type-1 or type-2 file via the "Browse" button next to the "Video source" field. Your AVI file will automatically be entered in the "Audio source" field, too, and an "Output file name" will be suggested.
We are going to create elementary streams as input for a DVD authoring program. In the "Stream type" box select "ES Video+Audio", if you want to create an MP2 file in TMPGEnc (skipping the BeSweet step above). Else select "ES Video only" (MP2 or AC3 created by BeSweet). Click the "Load" button, and open a template, either "DVD (PAL).mcf" or "DVD (NTSC).mcf".
Click on the "Setting" button to make further adjustments. Because you loaded a template, many options are greyed out. If you'd like to change these for some reason, load the template "unlock.mcf", which you will find in the subdirectory "Extra". In this guide we won't need that.
Let's have a look at the "Video" tab first. You may leave the "Rate control mode" settings to the defaults (Constant Quality, quality factor 65, min. bitrate 2000 kbps, max. bitrate 8000 kbps). If you need to fit a certain size, select "2-pass VBR(VBR)", and click the "Setting" button next to the rate control mode. Adjust the "Average bitrate" to your needs.
The "Encode mode" should be set according to your source material. If it's interlaced, select "Interlace"; if it's progressive, select "Non-interlace".
Leave the "DC component precision" at "9 bits", or set it to "10 bits".
The "Motion search precision" has a large impact on the final quality, but on the processing time consumed, too. "Motion estimate search (fast)" is a good compromise between quality and speed. If you want the best quality possible, select "High quality (slow)" or even "Highest quality (very slow)". But be warned: your encoding can take many hours!
Move over to the "Advanced" tab. Set "Video source type" according to your source (should be the same as "Encode mode" on the "Video" tab).
The "Field order" is for interlaced sources only. DV should be "Bottom field first (field B)", unless you have a strange source...
Under "Source aspect ratio" select one of the 4:3 or 16:9 settings, depending on your source again. E.g. I use "16:9 625 line (PAL)" for my 16:9 recordings, and "4:3 625 line (PAL)" for my 4:3 recordings.
Select "Full screen (keep aspect ratio)" as the "Video arrange Method".
You may activate filters here, too. I'll leave this topic to your experiments.
As we won't make changes to the GOP structure or the quantize matrices, skip to the "Audio" tab (which is not present if you selected stream type "ES (Video only)"). You may change the audio bitrate here, if you want to let TMPGEnc create the MP2 file.
Confirm the tabbed dialog by clicking the "OK" button, then click on "Start" in the upper left and wait until TMPGEnc is finished.
3.3 Canopus ProCoder
Start ProCoder. On the "Source" tab, add the DV file you want to encode. Once the file is opened, you'll see the "Source Parameters" on the right, containing information about the video and the audio. The only thing you may want to change here is the "Aspect Ratio" setting, which defaults to "4 x 3", but has to be changed into "16 x 9" for 16:9 sources.
Switch to the "Target" tab, and click the "Add" button. The "Add Target" dialog box opens, and you continue on its "VCD/DVD" tab. Select the appropriate template, either "MPEG2 - DVD PAL", or "MPEG2 - DVD NTSC". Confirm by clicking "OK".
The "Target Parameters" contain all the settings you can change before starting the conversion. First you may want to change the "Base Name" and the "Path", which specify filenames and location of your output files (video and audio). Under "Stream Type", make sure "MPEG2 Video + Wave file" is selected.
"Interlacing" will usually stay on "Lower/Odd field first", unless your source is progressive. In that case select "Non-Interlaced". Choose "4:3" or "16:9" for "Video Aspect Ratio", depending on whether you shot your DV in 4:3 or 16:9 mode. And there's the "Pixel Aspect Ratio" setting, which has to be set to "D1/...", either PAL or NTSC, either 4:3 or 16:9.
Under "Speed/Quality" you may select "Highest Quality". If you don't care for processing time at all, "Mastering Quality" may give slightly better results.
"CBR/VBR Type" should be set to either "VBR 1-pass" or "VBR 2-pass". The latter needs twice the encoding time, but you'll get closer to the specified bitrate, and thus your filesize will be predictable. For the same (average) bitrate "VBR 2-pass" reaches better quality. There are two video bitrates to be set: "Video Bitrate(kbps)" is the average bitrate you calculated at the top of step 3., whereas "Max. bitrate(kbps)" specifies the limit for the encoder. Set that one to 8000.
There are a lot more options available when you click the "Advanced" button, and you can add video and audio filters. As a beginner you can safely leave everything to the defaults here, but of course feel invited to experiment! E.g. if you recordet at 24 fps, you'll need to add a "Video Pulldown" filter.
Now you may want to save your profile ;-) You can create so-called droplets, too, but you have to find out yourself how to do that :-)
Finally switch to the "Convert" tab, and take a cup of coffee. You should end up with an m2v video file (MPEG-2 elementary stream) and a wav audio file.
Special thanks to Dali Lama for the inspiration!