manolito
9th May 2004, 17:36
After successfully converting numerous DVDs to SVCDs with DVD2SVCD plus D2SRoBa and FACAR, I decided that it was about time to backup some of my old VHS tapes. So I first read all the guides about capturing analog TV or VHS content. When it comes to encoding to SVCD mostly you can read about how to use VirtualDub for cropping, filtering and resizing and then use frameserver mode and feed the AVS script to your encoder.
I wanted a different approach. I wanted to recycle all the knowledge I had gathered with DVD conversions, mainly use D2SRoBa and FACAR and all my favourite filters. I did succeed after taking a couple of U-turns, and the results look great. I decided to post my experiences because some of the necessary information is a little hard to find.
I have the current versions of DVD2SVCD, D2SRoBa and FACAR installed. My source file was captured with VirtualVCR at a resolution of 720 x 576 (full PAL). I used the PicVideo MJPEG codec with a quality setting of 19, audio was uncompressed PCM. I had the option "Dynamically resample audio" checked to ensure perfect audio sync. The file played in MediaPlayer as well as in VirtualDub without any sync problems.
The first roadblock I ran into was audio extraction. When using the external VFW routines nothing at all was extracted. Using the internal routines I could extract 8 minutes of audio (of 75 minutes). The solution was DDogg's VirtualDub trick (it's in the stickies). Even after this the external VFW routines did not work, so it's essential to use AVI2SVCD's internal routines for audio extraction.
If you have to trim your source file you also should do this in VirtualDub. When converting AVIs, frame selection is not available in AVI2SVCD (why not?). The downside is that your free hard drive space has to be at least twice the size of your captured AVI.
The next problem came up when using my standard KISS and QMF filters. The preview gave me an error message saying that the source has to be in the YV12 colorspace. Most filters for AviSynth 2.5x don't work in YUY2, but going back to AviSynth 2.0 was not an option for me because FACAR and the QMF filters I use require AviSynth 2.5x. The captured file is always in YUY2 because the Brooktree/Conexant chip on the capture card does not support YV12.
The solution is to insert the line "ConvertToYV12()" into your script before the filters are called. This took care of the error message in the preview window, but when CCE was supposed to start for the first time, it simply refused to start giving a message saying that there was no codec for YV12 conversion available.
Time to use the "Search" button again. It seemed that mostly the DivX people had the same problem, but I also found 2 free codecs that support YV12. I used the LocoCodec (search for loco004.zip), and after installing this codec CCE was happy.
Before turning over the clip to CCE it has to be converted back to YUY2. This can be done automatically by AVI2SVCD, it inserts the command "ConvertToYUY2()" at the end of the script. The AviSynth documentation states however, that if the clip had been in the YUY2 domain before you should convert it back using the "ConvertBackToYUY2()" command, so I inserted this line into the D2S FACAR script after the filters.
Next was the question: To deinterlace or not to deinterlace?
For DVD output most people on this forum seem to agree that you should not deinterlace. For SVCD output I did not find clear answers. So I tried both, and I like the deinterlaced results a lot better. I decided to use the embedded "Smart Deinterlacer", but again I got an error in the preview window. More searching, and a very simple solution: Mpeg2Dec3.dll and Mpeg2Dec3dg.dll simply do not support Smart Deinterlacer. If you want to use Smart Deinterlacer you have to select Mpeg2Dec.dll in the AVI2SVCD frameserver tab.
My generated AviSynth_Script_File.avs looks like this:
LoadPlugin("E:\PROGRA~1\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2DEC.dll")
AVISource("I:\test.avi",audio=false)
ConvertToYUY2()
ConvertToYUY2()
SmartDeinterlace(2,10,True,False,True)
ResizeTo=0 global ResizeMethod=5 DebugMode=0
GammaCorrection=1.0 Hue=0 Saturation=1.0 Brightness=0 Contrast=1.0
DetectedTop=0 DetectedHeight=572
OverscanH=0.04 OverscanV=0.04 BlockOptimization=0 AsoTV=1
global Bicubic_b_Value=0 global Bicubic_c_Value=0.6
DestinationWidth=352
DestinationHeight=576
DestinationTop=0
DestinationBottom=0
ConvertToYV12()
LoadPlugin("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\SimpleResize\SimpleResize.dll")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\qmf15b1.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\QMF_functions.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\PreResize.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\FACAR.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\PostResize.avs")
ConvertBackToYUY2()
Import("I:\Movies\ResampleAudio.avs")
ResampleAudio(44100)
ConvertToYUY2()
A few more tips:
It makes sense to use CVD frame size (352 x 576/480) because a VHS source hardly exceeds a horizontal resolution of 200 lines.
If you decide to not deinterlace, make sure you select the appropriate template for CCE 2.66+ or change the corresponding values for CCE 2.50 in the D2S encoder tab. The "ConvertToYV12()" line in your script should also be changed to "ConvertToYV12(interlaced=true)".
For Smart Deinterlacer I used AVi2SVCD's default settings (Field only, Threshold 10, Denoise On) as well as Donald Graft's recommended settings (Frame only, Threshold 15, Denoise off). In both cases the results look very good, but with AVI2SVCD's default settings I get a slightly lower Q, so I use these.
It seems to be common that in VHS or TV captures you get some artefacts at the very bottom of the screen, usually about four lines. If you are using FACAR it is very easy to get rid of these artefacts. If the movie was 1.85:1 or 2.35:1 FACAR will crop these lines automatically, but for a 4:3 movie you can manually decrease the value for "DetectedHeight" by 4. For a 4:3 PAL movie FACAR would detect a height of 576. By changing this value to 572 the four bottom lines will be cropped and the whole picture will be stretched vertically by 4 pixels, but I doubt that anyone could detect this.
OK, I hope this can be useful for some of you guys. Any suggestions for making the whole process even simpler are highly appreciated.
Cheers
manolito
I wanted a different approach. I wanted to recycle all the knowledge I had gathered with DVD conversions, mainly use D2SRoBa and FACAR and all my favourite filters. I did succeed after taking a couple of U-turns, and the results look great. I decided to post my experiences because some of the necessary information is a little hard to find.
I have the current versions of DVD2SVCD, D2SRoBa and FACAR installed. My source file was captured with VirtualVCR at a resolution of 720 x 576 (full PAL). I used the PicVideo MJPEG codec with a quality setting of 19, audio was uncompressed PCM. I had the option "Dynamically resample audio" checked to ensure perfect audio sync. The file played in MediaPlayer as well as in VirtualDub without any sync problems.
The first roadblock I ran into was audio extraction. When using the external VFW routines nothing at all was extracted. Using the internal routines I could extract 8 minutes of audio (of 75 minutes). The solution was DDogg's VirtualDub trick (it's in the stickies). Even after this the external VFW routines did not work, so it's essential to use AVI2SVCD's internal routines for audio extraction.
If you have to trim your source file you also should do this in VirtualDub. When converting AVIs, frame selection is not available in AVI2SVCD (why not?). The downside is that your free hard drive space has to be at least twice the size of your captured AVI.
The next problem came up when using my standard KISS and QMF filters. The preview gave me an error message saying that the source has to be in the YV12 colorspace. Most filters for AviSynth 2.5x don't work in YUY2, but going back to AviSynth 2.0 was not an option for me because FACAR and the QMF filters I use require AviSynth 2.5x. The captured file is always in YUY2 because the Brooktree/Conexant chip on the capture card does not support YV12.
The solution is to insert the line "ConvertToYV12()" into your script before the filters are called. This took care of the error message in the preview window, but when CCE was supposed to start for the first time, it simply refused to start giving a message saying that there was no codec for YV12 conversion available.
Time to use the "Search" button again. It seemed that mostly the DivX people had the same problem, but I also found 2 free codecs that support YV12. I used the LocoCodec (search for loco004.zip), and after installing this codec CCE was happy.
Before turning over the clip to CCE it has to be converted back to YUY2. This can be done automatically by AVI2SVCD, it inserts the command "ConvertToYUY2()" at the end of the script. The AviSynth documentation states however, that if the clip had been in the YUY2 domain before you should convert it back using the "ConvertBackToYUY2()" command, so I inserted this line into the D2S FACAR script after the filters.
Next was the question: To deinterlace or not to deinterlace?
For DVD output most people on this forum seem to agree that you should not deinterlace. For SVCD output I did not find clear answers. So I tried both, and I like the deinterlaced results a lot better. I decided to use the embedded "Smart Deinterlacer", but again I got an error in the preview window. More searching, and a very simple solution: Mpeg2Dec3.dll and Mpeg2Dec3dg.dll simply do not support Smart Deinterlacer. If you want to use Smart Deinterlacer you have to select Mpeg2Dec.dll in the AVI2SVCD frameserver tab.
My generated AviSynth_Script_File.avs looks like this:
LoadPlugin("E:\PROGRA~1\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2DEC.dll")
AVISource("I:\test.avi",audio=false)
ConvertToYUY2()
ConvertToYUY2()
SmartDeinterlace(2,10,True,False,True)
ResizeTo=0 global ResizeMethod=5 DebugMode=0
GammaCorrection=1.0 Hue=0 Saturation=1.0 Brightness=0 Contrast=1.0
DetectedTop=0 DetectedHeight=572
OverscanH=0.04 OverscanV=0.04 BlockOptimization=0 AsoTV=1
global Bicubic_b_Value=0 global Bicubic_c_Value=0.6
DestinationWidth=352
DestinationHeight=576
DestinationTop=0
DestinationBottom=0
ConvertToYV12()
LoadPlugin("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\SimpleResize\SimpleResize.dll")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\qmf15b1.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\QMF_functions.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\PreResize.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\FACAR.avs")
Import("E:\Programme\DVD2SVCD\Avisynth2.5 Plugins\FACAR\PostResize.avs")
ConvertBackToYUY2()
Import("I:\Movies\ResampleAudio.avs")
ResampleAudio(44100)
ConvertToYUY2()
A few more tips:
It makes sense to use CVD frame size (352 x 576/480) because a VHS source hardly exceeds a horizontal resolution of 200 lines.
If you decide to not deinterlace, make sure you select the appropriate template for CCE 2.66+ or change the corresponding values for CCE 2.50 in the D2S encoder tab. The "ConvertToYV12()" line in your script should also be changed to "ConvertToYV12(interlaced=true)".
For Smart Deinterlacer I used AVi2SVCD's default settings (Field only, Threshold 10, Denoise On) as well as Donald Graft's recommended settings (Frame only, Threshold 15, Denoise off). In both cases the results look very good, but with AVI2SVCD's default settings I get a slightly lower Q, so I use these.
It seems to be common that in VHS or TV captures you get some artefacts at the very bottom of the screen, usually about four lines. If you are using FACAR it is very easy to get rid of these artefacts. If the movie was 1.85:1 or 2.35:1 FACAR will crop these lines automatically, but for a 4:3 movie you can manually decrease the value for "DetectedHeight" by 4. For a 4:3 PAL movie FACAR would detect a height of 576. By changing this value to 572 the four bottom lines will be cropped and the whole picture will be stretched vertically by 4 pixels, but I doubt that anyone could detect this.
OK, I hope this can be useful for some of you guys. Any suggestions for making the whole process even simpler are highly appreciated.
Cheers
manolito