View Full Version : Peer Review Please - Analog Capture to DVD
puddy
23rd March 2007, 16:44
I'd like to describe my process for capturing analog video to final DVD creation and get some feedback about anything I could do better or faster. I'm posting in the AviSynth forum because the capturing part is working fine, it is the AviSynth and encoding that concerns me.
I'm in the USA so my source material is NTSC 29.97 interlaced.
Machine specs are: P4 2.8GHz HT Enabled, 512 MBs DDR400 RAM (yes, I know this is low, but I don't think it is the main reason some of my process described below is slow), ATI All-In-Wonder (AIW) 9600 (drivers used are described below), several 120 GB ATA hard drives running at UDMA 5 and an Echo Gina20 sound card for audio capture locked at 16-bit, 48khz (old, but professional grade at the time) running WinXP Pro SP2 with all updates installed.
I'm capturing video from my Sony Hi8 CamCorder via s-video into my AIW using VirtualDub 1.7.1 (this is beta at the moment, but I've had no problems). This worked fantastic!
FYI, I'm using the newest ATI drivers (v7.2) using just the regular Control Panel (CP), not the massive and bloated Catalyst Control Center (CCC). They are available here in a nice package:
http://www.ngohq.com/home.php?page=Files&go=cat&dwn_cat_id=18
If you want more tweaks for your card, get the ATI Tray Tools found here (well written and tested):
http://www.guru3d.com/article/atitraytools/189/
This next suggestion may seem scarry, bit it works so well I must recommend it. If you are like you me you've installed so many different versions of ATI drivers. Do yourself and your system a favor and use DriverCleaner Pro. Below is a link to the free version:
http://downloads.guru3d.com/download.php?det=745
Use Windows Add/Remove Software to remove any ATI related installs first. Do not reboot. Then run each ATI cleaner available in DriverCleaner one after the other. Then reboot. Windows will find your video card but won't have any default drivers to install and mess things up. If any boxes come up asking if you want to search for drivers just cancel them. Then run the driver package downloaded from ngohq.com above. That is what I did, works so nice with my setup at least. Then I install the ATI Tray Tools just to have a little more tweaking power, but I don't think this step is necessary for getting good captures.
NOTE: These newer ATI drivers do not seem to work for older capture programs like AVI IO (which I've always used before now) but work GREAT with the newest VirtualDub! I was very happy as I've had capturing problems in the past.
After capture, my video is 29.97fps, 720x480 interlaced, codec used was Huffy 2.1.1 set to fastest. I'm going to be making DVD's for viewing on TV, so I want it to stay interlaced and at this resolution.
Once the capture is done I save the audio out into an uncompressed .wav file using VirtualDub again and use Aften to convert to AC3 (Dolby digital) at 224kbps. The GUI I used for Aften can be found here:
http://www.thefrontend.net/EncWAVtoAC3/
UPDATE: I've started using Sony Vegas for the AC3 conversion because I can also fix DC offset, normalize and tweak it in other ways before converting it to AC3. All of these tweaks may be possible with Aften as well, but for me, Vegas is just a easy.
Install AviSynth if not already installed. I'm using version 2.5.7.
Next I wrote the following AviSynth script to feed HC Encoder 0.20. While typing this post I went back and reworked the script because it was just too slow. It is still slow, but then again, that is why I'm posting! Here it is:
AviSource("capture.avi")
ConvertToYV12(interlaced=true)
TemporalCleaner(ythresh=2, cthresh=4)
Crop(0,8,-16,-8,True)
AddBorders(8, 8, 8, 8, $000000)
Line 1: Brings in my captured AVI (.avi in same directory as script)
Line 2: Required by HC Encoder. I do not know enough about colorspace but I figured I'd convert it first and allow all filters to run in the colorspace that will ultimately be feed to the encoder. Just seemed to make sense.
Line 3: Does some basic cleanup
Line 4: Basically shifts the image to the right slightly as the Sony Hi8 camera fills the overscan fully on the left but not on the right. So I use this command to "get back" a little of the hidden video that would normally be lost in the overscan area when viewed on a traditional TV.
Line 5: In conjunction with line 4 I then clean up any junk around the edges that would normally be in the overscan area. I could bump this up to 16,16,16,16 and I think I'd gain some benefits during the encode stage, but I'd also be losing real video area. I will sometimes be watching these on a widescreen TV and if I leave the TV set to 4:3 I'm able to see the left and right overscan areas. So why mask it out?
In HC Encoder I hit the Make-DVD-Compliant button just as a baseline. Then I tweaked things a little.
1. Choose the Best quality option.
2. Set DC Precision to 10 (because I'm going to do high bitrate)
3. Aspect ratio 4:3
4. Choose Interlaced.
5. Do not choose 3:2 Pulldown
6. Choose scene change detection
7. Choose autogop set to 18.
8. Choose closed gops
9. I set my average AND max bitrate to 9624. Huh? What? Let me explain below.
10. Interlaced Fields set to: TTF
11. scan method set to: alternate
12. constant Quantization: off (maybe I should be using this? See #9 above)
13. VBR Bias: 20 (again, advice here would be helpful)
14. VBV Check: on
15. last I-fame: off
16. write seq endcode: on
17. matrix: MPEG (not MPEG Standard). Advice here please keeping in mind my high bitrates.
18. Adaptive martix: yes (I've copied the "matrix1.dll - mild raise" DLL into the HC home directory. I wanted to try this because the older Sony camcorder doesn't do well in low light, so those scenes are grainy and could benefit from the extra bits.)
Ok, #9 above is set this way because of a couple of reasons.
1. 9624 (video) + 224 (audio) = 9848 and DVD Author 2 (which I use later in this process) will complain if this is any higher.
2. The reason it is so high is because I'm converting 2 hours of video and I'm going to put it on two DVD's with about 1 hour of video each for the best quality (and also ease of watching...it is fun to watch videos for an hour, but 2 hours gets to be rough with the kids sometimes). So, I have the ability to use a very high bitrate because I have the extra DVD space.
This is where I'm confused. I have a feeling I could be using a faster encoding method than the 2 pass from HC Encoder but I don't want to sacrifice any quality. I'm looking for recommendations here, please. I also don't want to totally abandon this encoding method because there will probably be times when I do want to put 2 hours of video on one DVD. So I still want to have a nice process in place to accomplish this when necessary.
Unfortunately, 2 hours of captured video takes over 9 hours to process using this AviSynth script and HC Encoder with these settings. See pasted HC Encoder log file in next post.
I just want to be clear here that I am encoding the video unedited, that is why I'm using closed gops because I'm going to do my editing later directly on the encoded MPEG files. I've found you can do adequate editing and really reduce any audio-sync issues this way.
Anyway, after the encode is done I use TMPGEnc DVD Author 2 to create a DVD using the mpgs created by HC Encoder and the AC3 output from Aften (or Vegas). Many people have noticed that DVD Author 2 often tries to reencode your video. I've found that if you keep your video within MPEG2 specs and make sure you used closed gops it will not try to reencode it. For more info, take a look at this thread:
http://forum.doom9.org/showthread.php?t=110778
PLEASE NOTE!! I do all of my editing in TMPGEnc DVD Author 2 directly on the encoded mpg, not in VirtualDub or by using trim() statements in the AviScript (both of which I've tried in the past and always had audio sync issues).
The result is a very nice and IN-SYNC DVD. But this is too long of a process.
Now my questions:
1. What can I do to make this more efficient?
2. What tweaks can I do to my AviSynth script?
3. Am I correct to crop and add borders at the end of the script? I think so, but I'd like a confirmation.
4. I kind of answered this myself as a learned that the basic TemporalSmoother works fine with interlaced material so I decided to just make that one slightly more aggressive and not use any other filtering.
5. Is there a way I can do some kind of constant bitrate encoding and retain the same quality as the 2 pass encoding keeping in mind my high bitrates?
6. Any other advice or things you may have noticed. I'll take any advice, I'm open to anything for improvement purposes.
7. Who is bob and is he my uncle? :D
For anybody who is curious I'm posting the HC Encoder output log in the next post.
Thanks All!
puddy
puddy
23rd March 2007, 16:45
-----------------------------------------
| HCenc - MPEG2 encoder - rel. 0.20.0.0 |
-----------------------------------------
MPEG profile@level: MP@ML
input: e:\mfhm resources\aug 20 2006 - feb 26 2007 tape\caputure_full_screen.avs
output: e:\mfhm resources\aug 20 2006 - feb 26 2007 tape\capture_vd_final_tff_9624kbps.m2v
--------------------
| encoder settings |
--------------------
profile: BEST
frames: 0 221521
framerate: 29.970
aspect ratio: 4:3
bitrate Kb/s: 9624
max. bitrate Kb/s: 9624
pulldown: no
closed gops: yes
VBV check: yes
scene change det.: yes
interlaced: yes, TFF
goplen,B-pic: AUTO
dc_precision: 10
scan method: ALTERNATE
bias: 20
chapter frames: 0
time code: 0 0 0 0
CPU: SSE2
matrix: MPEG, adaptive
------------------
| source stats |
------------------
nr. of frames in source: 221522
width*height: 720x480
fps: 29.97
nr. of frames to encode: 221522
frames to encode: 0 - 221521
---------------------
| encoding - pass 1 |
---------------------
pass1 encoding time: 3:07:03 (11223 s)
fps: 19.7
--------------------------------
| encoding - intermediate pass |
--------------------------------
bitrate set to: 9624 kb/s
est. outfile length: 8683511 kB
intermediate encoding time: 57.2 s
---------------------
| encoding - pass 2 |
---------------------
*** INFO, adjusting average bitrate: -0.07 %
*** INFO, adjusting average bitrate: -0.14 %
*** INFO, adjusting average bitrate: -0.22 %
*** INFO, adjusting average bitrate: -0.30 %
*** INFO, adjusting average bitrate: -0.36 %
*** INFO, adjusting average bitrate: -0.42 %
*** INFO, adjusting average bitrate: -0.47 %
*** INFO, adjusting average bitrate: -0.54 %
*** INFO, adjusting average bitrate: -0.60 %
*** INFO, adjusting average bitrate: -0.66 %
*** INFO, adjusting average bitrate: -0.72 %
*** INFO, adjusting average bitrate: -0.78 %
*** INFO, adjusting average bitrate: -0.84 %
*** INFO, adjusting average bitrate: -0.91 %
*** INFO, adjusting average bitrate: -0.98 %
*** INFO, adjusting average bitrate: -1.04 %
*** INFO, adjusting average bitrate: -1.08 %
*** INFO, adjusting average bitrate: -1.14 %
*** INFO, adjusting average bitrate: -1.21 %
*** INFO, adjusting average bitrate: -1.30 %
*** INFO, adjusting average bitrate: -1.37 %
*** INFO, adjusting average bitrate: -1.42 %
*** INFO, adjusting average bitrate: -1.47 %
*** INFO, adjusting average bitrate: -1.54 %
*** INFO, adjusting average bitrate: -1.63 %
*** INFO, adjusting average bitrate: -1.72 %
*** INFO, adjusting average bitrate: -1.81 %
*** INFO, adjusting average bitrate: -1.89 %
*** INFO, adjusting average bitrate: -1.97 %
*** INFO, adjusting average bitrate: -2.04 %
*** INFO, adjusting average bitrate: -2.12 %
*** INFO, adjusting average bitrate: -2.20 %
*** INFO, adjusting average bitrate: -2.31 %
*** INFO, adjusting average bitrate: -2.40 %
*** INFO, adjusting average bitrate: -2.49 %
*** INFO, adjusting average bitrate: -2.58 %
*** INFO, adjusting average bitrate: -2.68 %
*** INFO, adjusting average bitrate: -2.80 %
*** INFO, adjusting average bitrate: -2.91 %
*** INFO, adjusting average bitrate: -3.01 %
*** INFO, adjusting average bitrate: -3.10 %
*** INFO, adjusting average bitrate: -3.19 %
*** INFO, adjusting average bitrate: -3.27 %
*** INFO, adjusting average bitrate: -3.35 %
*** INFO, adjusting average bitrate: -3.43 %
*** INFO, adjusting average bitrate: -3.52 %
*** INFO, adjusting average bitrate: -3.60 %
*** INFO, adjusting average bitrate: -3.69 %
*** INFO, adjusting average bitrate: -3.76 %
*** INFO, adjusting average bitrate: -3.85 %
*** INFO, adjusting average bitrate: -3.92 %
*** INFO, adjusting average bitrate: -3.99 %
*** INFO, adjusting average bitrate: -4.05 %
*** INFO, adjusting average bitrate: -4.11 %
*** INFO, adjusting average bitrate: -4.17 %
*** INFO, adjusting average bitrate: -4.24 %
*** INFO, adjusting average bitrate: -4.31 %
*** INFO, adjusting average bitrate: -4.38 %
*** INFO, adjusting average bitrate: -4.41 %
*** INFO, adjusting average bitrate: -4.52 %
*** INFO, adjusting average bitrate: -4.61 %
*** INFO, adjusting average bitrate: -4.72 %
*** INFO, adjusting average bitrate: -4.82 %
*** INFO, adjusting average bitrate: -4.94 %
*** INFO, adjusting average bitrate: -5.03 %
*** INFO, adjusting average bitrate: -5.14 %
*** INFO, adjusting average bitrate: -5.26 %
*** INFO, adjusting average bitrate: -5.35 %
*** INFO, adjusting average bitrate: -5.47 %
*** INFO, adjusting average bitrate: -5.56 %
*** INFO, adjusting average bitrate: -5.72 %
*** INFO, adjusting average bitrate: -5.83 %
*** INFO, adjusting average bitrate: -5.94 %
*** INFO, adjusting average bitrate: -6.06 %
*** INFO, adjusting average bitrate: -6.13 %
*** INFO, adjusting average bitrate: -6.21 %
*** INFO, adjusting average bitrate: -6.28 %
*** INFO, adjusting average bitrate: -6.36 %
*** INFO, adjusting average bitrate: -6.45 %
*** INFO, adjusting average bitrate: -6.53 %
*** INFO, adjusting average bitrate: -6.73 %
*** INFO, adjusting average bitrate: -6.88 %
*** INFO, adjusting average bitrate: -7.00 %
*** INFO, adjusting average bitrate: -7.13 %
*** INFO, adjusting average bitrate: -7.24 %
*** INFO, adjusting average bitrate: -7.38 %
*** INFO, adjusting average bitrate: -7.52 %
*** INFO, adjusting average bitrate: -7.63 %
*** INFO, adjusting average bitrate: -7.75 %
*** INFO, adjusting average bitrate: -7.85 %
*** INFO, adjusting average bitrate: -7.99 %
*** INFO, adjusting average bitrate: -8.10 %
*** INFO, adjusting average bitrate: -8.18 %
*** INFO, adjusting average bitrate: -8.27 %
*** INFO, adjusting average bitrate: -8.40 %
*** INFO, adjusting average bitrate: -8.57 %
*** INFO, adjusting average bitrate: -8.75 %
pass2 encoding time: 5:31:53 (19913 s)
fps: 11.1
------------------
| encoding stats |
------------------
total CPU time: 8:39:54 (31194 s)
unknown intra matrix used
unknown non-intra matrix used
nr. of gops: 12828
nr. of frames: 221522
nr. of I-frames: 12828
nr. of P-frames: 104170
nr. of B-frames: 104524
average bitrate: 8851
minimum bitrate: 142
maximum bitrate: 9623
bytes in bitstream: 8180000356
bits in bitstream: 65440002848
total elapsed time: 9:06:38 (32797.92 s)
Thanks All!
puddy
manolito
23rd March 2007, 18:19
This is a very long post, I will try to focus on the most important issues:
I do analog TV capture conversions all the time, my machine is a lot slower than yours, but I live in PAL country, so some differences may apply.
At the bitrates you are using, any decent encoder will deliver very high quality. To achieve a faster speed there are mainly two things you can do:
1. Do not use filters unless you have to.
2. Use a one-pass conversion method.
HC cannot do CBR, it only has a CQ_MaxBitrate mode. To make this method work, you will have to do some test encodes using a small (1% - 2%) sample of your source AVI.
I would recommend to use QuEnc in CBR mode (maybe try 1-pass VBR also). I think that you will have a hard time to see any visual degradation compared to HC at these high bitrates.
Some other things that I would like to bring up about your method which will not improve speed:
With your capture method chances are that you will get a slight aspect ratio error. If you can live with it, leave everything as it is. Avoid to resize by a small ratio. For my PAL captures with a BT based capture card I have to capture at 696 x 576 and add 12 pixels to the left and to the right to get the correct aspect ratio.
You did not say which kind of sources you are capturing. Are they truly interlaced or is it telecined film? If you capture telecined film, you might get a better quality by applying IVTC first, then encode as progressive and apply pulldown. Most encoders are significantly faster in progressive mode.
Editing the already converted file is OK if you are only removing a small part of the file. In my case the commercials make up up to 30% of the movie, so editing them out after conversion will result in a DVD which is partly empty. I use the following method to edit out commercials:
I load the captured AVI into VDub and do my edits. Then I save my processing settings to a VCF file ("Include selection and edit list" must be checked). Then I load this VCF file into a program called "VCF2AVS" which converts the VDub edits into an AVS file with the corresponding Trim commands. This AVS file can be imported into your script. I never had any audio sync problems with this method.
Hope you can use some of this. Good luck...
Cheers
manolito
puddy
23rd March 2007, 18:51
To achieve a faster speed there are mainly two things you can do:
1. Do not use filters unless you have to.
I'm using very minimal at the moment. Do you think what I'm using is unnecessary in some way? Just curious...
2. Use a one-pass conversion method.
HC cannot do CBR, it only has a CQ_MaxBitrate mode. To make this method work, you will have to do some test encodes using a small (1% - 2%) sample of your source AVI.
I would recommend to use QuEnc in CBR mode (maybe try 1-pass VBR also). I think that you will have a hard time to see any visual degradation compared to HC at these high bitrates.
Yes, I suspected that at such high bitrates most any encoder would do a good job. I've never used QuEnc, so it will be all new to me. It took me a long time to learn all the correct settings for HC Encoder. But I will take a look at QuEnc nonetheless.
With your capture method chances are that you will get a slight aspect ratio error. If you can live with it, leave everything as it is. Avoid to resize by a small ratio. For my PAL captures with a BT based capture card I have to capture at 696 x 576 and add 12 pixels to the left and to the right to get the correct aspect ratio.
Ok, I don't understand this one. What is wrong with 720x480 capture that would make it not have the correct aspect ratio when played back on a regular TV? Sorry...I need help there.
You did not say which kind of sources you are capturing. Are they truly interlaced or is it telecined film? If you capture telecined film, you might get a better quality by applying IVTC first, then encode as progressive and apply pulldown. Most encoders are significantly faster in progressive mode.
Yes, I did mention what my source video was. It is definitly interlaced material and from everything I've read I want to keep it interlaced through the whole process to retain all the quality I can. Remember, this is for DVD playbak on regular TV's, so it is perfectly fine being interlaced.
I load the captured AVI into VDub and do my edits. Then I save my processing settings to a VCF file ("Include selection and edit list" must be checked). Then I load this VCF file into a program called "VCF2AVS" which converts the VDub edits into an AVS file with the corresponding Trim commands. This AVS file can be imported into your script. I never had any audio sync problems with this method.
That is interesting... but I still don't see how your audio is going to stay in sync unless you are using your encoder to process the audio. Remember, HC Encoder doesn't process audio at all, so I can't feed it edited video and then try to overlay the unedited audio back over it. See what I mean?
Hope you can use some of this. Good luck...
Cheers
manolito
Thank you! :)
puddy
Blue_MiSfit
23rd March 2007, 23:51
That is interesting... but I still don't see how your audio is going to stay in sync unless you are using your encoder to process the audio. Remember, HC Encoder doesn't process audio at all, so I can't feed it edited video and then try to overlay the unedited audio back over it. See what I mean?
That's true, but its easy enough to load the AVS into VirtualDub, and do a file -> save WAV. It's probably also possible to use one of the programs that will let Aften connect to AviSynth directly, without the need for intermediate files. I think BeHappy can do this, but I'm not 100% sure...
Also, I think the old rule that less time = less quality (to a certain extent) holds true. I would be interested in comparing the quality of a single pass CBR encode at ~9000kbit from QuEnc to a 2 pass VBR encode at the same bitrate from HC .20. I would imagine that noisy, interlaced analog sources would be the most challenging encode for even modern MPEG-2 encoders.
If some of your footage is very under-exposed, and you want to bring out details in shadows without blowing out highlights, you might check out HDRAgc. It's a very nice AviSynth plugin, but again it will slow you downl
I'm a big fan of fft3dfilter for filtering, but since you are trying to improve your speed, that's not a good plan :) Quality and speed are generally inversely proportional, in my mind :D
Still, you're thinking about doing only 1 pass, so you might be able to toss in some filters 'for free'...
Let us know how it goes.
~MiSfit
puddy
24th March 2007, 02:54
That's true, but its easy enough to load the AVS into VirtualDub, and do a file -> save WAV. It's probably also possible to use one of the programs that will let Aften connect to AviSynth directly, without the need for intermediate files. I think BeHappy can do this, but I'm not 100% sure...
Both of these are very interesting and would save time for sure. It is much easier to edit in VirtualDub than in DVD Author 2. Although since I'm setting chapter points in DVD Author 2 anyway, it is pretty easy to find and cut out any unneeded video.
Encoding AC-3 on the fly out of AviSynth is also pretty cool. That would be a time and step saver to get that working.
Employing both ideas would speed the overall process up and allow it to be less cumbersome. But it would take some trial & error time to get it working consistantly.
Also, I think the old rule that less time = less quality (to a certain extent) holds true. I would be interested in comparing the quality of a single pass CBR encode at ~9000kbit from QuEnc to a 2 pass VBR encode at the same bitrate from HC .20. I would imagine that noisy, interlaced analog sources would be the most challenging encode for even modern MPEG-2 encoders.
Well, you know how family camcorder footage is... it is all over the place. Light to dark, steady to shakey. I have a lot of footage and I'm not interested in making it all pretty and perfect. It is fun to watch it as it was really captured. But I do cut out any bad camera edits where it goes to static in between shots or times when the camera was left on by mistake, of course.
Let us know how it goes.
I'll try... I'm still looking for advice on some of my other more technical questions if anybody is still reading this. :)
manolito
25th March 2007, 03:12
The equation "More Time = More Quality" does generally apply, but it is not a linear function. For an average bitrate above 9000 kbps even the the professional mastering houses would most likely use CBR (ask MugFunky). But you are the ultimate judge here. Just do a few short test conversions and compare the results.
Regarding the method to convert VDub edit settings to AVS Trim commands of course I forgot to mention that you have to save the audio after making your edits. This saved WAV file will represent the audio after editing.
But if you are going to give QuEnc a try, it gets even easier. QuEnc also does audio encoding to AC3, so you really just have to save the VDub settings after making your edits.
This would be my recommended procedure:
Get "VCF2AVS" by DarkSoul. You can find it in the Doom9 forum as an attachment. Use the "revisited" version from March 2006.
Load the captured AVI into VDub and do your edits. Save the processing settings into a VCF file.
Run VCF2AVS. Select your script as the target AVS file. The trim commands will be appended to your script. (Leave them at the end. You do not have to modify your script for QuEnc, the input has to be in YV12 just like for HC.)
Run QuEnc. Select your script as the input. Check MPEG2, enter your desired bitrate, uncheck VBR, High Quality, Trellis and 2Pass. Go to the advanced options and make your settings. Do not use "Extreme and Slow" or "Auto Max Bitrate". You should probably not mess with a different matrix at your bitrate, just use the standard matrix.
For Audio you can either get separate elementary streams by selecting "Separate Passes", or you can get an already muxed output file by selecting "DVD" as your profile. For AC3 you might want to increase the audio bitrate a little (maybe 384), because QuEnc uses the FFMPEG routines which might not be up to the quality you get from Aften.
For the aspect ratio error if you capture at 720 x 480 you should have a look at the Doom9 Analog Capture Guide. This is advanced stuff, and if you never noticed that your aspect ratio is slightly off, you might just as well ignore the whole thing.
For any capture chip / driver combination you have a certain "capture window". The real world consequence is that horizontally you will end up with a few too much or too little pixels which have been captured. There are several methods to correct this error, I used a trial and error approach.
In chapter 10 of the Doom9 capture guide you will find a link to some test videos by Arachnotron. Download the one that applies to you (NTSC DVD). Burn a DVD from this downoaded file and play it in your standalone DVD player. Don't worry about the vertical dimension, we are only interested in the horizontal part. The DVD has 720 pixels horizontally, but you will see only a part of them on your TV set. Have a close look at your TV screen and note the number of pixels you can actually see horizontally. Probably around 680 pixels.
Now connect the analog output of your DVD player to the input of your capture card and capture a minute or two at 720 x 480. Encode and burn a DVD. Now play this DVD and count the number of horizontal pixels on your TV. If they are the same as from the original DVD you are very lucky. But most likely there will be a difference.
To correct this difference there are several approaches. But you should keep in mind that resizing by a small amount is not a good idea. Adding borders or cropping off some pixels without resizing will always give you a better quality.
Example:
The "original" DVD displays 680 pixels horizontally, the "captured" DVD only displays 660 pixels. The captured picture is stretched hoizontally by 20 pixels. To correct this you have to capture at 700 x 480 and add 10 pixels to the left and to the right (with the "AddBorders" command) to get the desired resolution of 720 x 480.
If the "captured" DVD shows 700 pixels, the picture is squeezed horizontally. Now you should capture at 740 x 480 and crop off 10 pixels to the left and to the right.
Cheers
manolito
puddy
25th March 2007, 15:34
Regarding the method to convert VDub edit settings to AVS Trim commands of course I forgot to mention that you have to save the audio after making your edits. This saved WAV file will represent the audio after editing.
Yes, I tried this method and it does work nicely. Saved me some cumbersome editing in DVD Author 2 and the audio DOES stay in sync.
But if you are going to give QuEnc a try, it gets even easier. QuEnc also does audio encoding to AC3, so you really just have to save the VDub settings after making your edits.
I'm trying this now to see if QuEnc's AC3 encoding is acceptable. If so, this might be something to consier. But this method won't allow me to do other things to the audio, like DC Offset correction and some slight RMS Normalization to even out the wildly varying audio of home movies.
This would be my recommended procedure:
Run QuEnc. Select your script as the input. Check MPEG2, enter your desired bitrate, uncheck VBR, High Quality, Trellis and 2Pass. Go to the advanced options and make your settings. Do not use "Extreme and Slow" or "Auto Max Bitrate". You should probably not mess with a different matrix at your bitrate, just use the standard matrix.
I think I misunderstood you. Are you saying to uncheck all of these? VBR, High quality, Trellis and 2pass? I unchecked VBR but thought you meant to check all the rest. Whoops... my encode is taking a VERY long time. So my settings are probably not what you were recomending. Once it is done I'll try with all those options off.
For the aspect ratio error if you capture at 720 x 480 you should have a look at the Doom9 Analog Capture Guide. This is advanced stuff, and if you never noticed that your aspect ratio is slightly off, you might just as well ignore the whole thing.
For any capture chip / driver combination you have a certain "capture window". The real world consequence is that horizontally you will end up with a few too much or too little pixels which have been captured. There are several methods to correct this error, I used a trial and error approach.
In chapter 10 of the Doom9 capture guide you will find a link to some test videos by Arachnotron. Download the one that applies to you (NTSC DVD). Burn a DVD from this downoaded file and play it in your standalone DVD player. Don't worry about the vertical dimension, we are only interested in the horizontal part. The DVD has 720 pixels horizontally, but you will see only a part of them on your TV set. Have a close look at your TV screen and note the number of pixels you can actually see horizontally. Probably around 680 pixels.
Now connect the analog output of your DVD player to the input of your capture card and capture a minute or two at 720 x 480. Encode and burn a DVD. Now play this DVD and count the number of horizontal pixels on your TV. If they are the same as from the original DVD you are very lucky. But most likely there will be a difference.
To correct this difference there are several approaches. But you should keep in mind that resizing by a small amount is not a good idea. Adding borders or cropping off some pixels without resizing will always give you a better quality.
Example:
The "original" DVD displays 680 pixels horizontally, the "captured" DVD only displays 660 pixels. The captured picture is stretched hoizontally by 20 pixels. To correct this you have to capture at 700 x 480 and add 10 pixels to the left and to the right (with the "AddBorders" command) to get the desired resolution of 720 x 480.
If the "captured" DVD shows 700 pixels, the picture is squeezed horizontally. Now you should capture at 740 x 480 and crop off 10 pixels to the left and to the right.
Ahhhh... I will look into this more. So this process reveals the "real" capture window of the video card (an AIW 9600 in my case). Viewing on a TV is just a comparison tool, it isn't as if you are optimizing just for viewing on that TV, correct?
Thanks again... this is a great leaning experience.
puddy
manolito
25th March 2007, 17:41
I think I misunderstood you. Are you saying to uncheck all of these? VBR, High quality, Trellis and 2pass? I unchecked VBR but thought you meant to check all the rest. Whoops... my encode is taking a VERY long time. So my settings are probably not what you were recomending. Once it is done I'll try with all those options off.
Yes, I am saying that you should UNCHECK all these options. High Quality will give you better quality at low bitrates, but certainly not at bitrates above 9000 kbps. Trellis is "problematic" (to say it in a nice way), and for CBR encoding the 2-pass option is meaningless anyway. Also stay away from the "Extreme and Slow" option under the Advanced tab.
Viewing on a TV is just a comparison tool, it isn't as if you are optimizing just for viewing on that TV, correct?
Right, you do the optimization for a given chipset/driver combination, not for a specific TV set.
Cheers
manolito
puddy
26th March 2007, 04:26
Yes, I am saying that you should UNCHECK all these options. High Quality will give you better quality at low bitrates, but certainly not at bitrates above 9000 kbps. Trellis is "problematic" (to say it in a nice way), and for CBR encoding the 2-pass option is meaningless anyway. Also stay away from the "Extreme and Slow" option under the Advanced tab.
Humm... results were not very good. Even the QuEnc encode I did with all the high quality settings on (but not VBR) doesn't look as good as the HC Encoder one. And with the settings set low in QuEnc, well... it was not pretty. So I'm either doing something wrong or I should just stick with HC Encoder for now. Maybe I can use CCE... haven't used that in years.
manolito
26th March 2007, 13:57
Can you please post the QuEnc settings you used, mainly the settings under the "Advanced" tab?
Cheers
manolito
puddy
27th March 2007, 03:37
For the aspect ratio error if you capture at 720 x 480 you should have a look at the Doom9 Analog Capture Guide. This is advanced stuff, and if you never noticed that your aspect ratio is slightly off, you might just as well ignore the whole thing.
For any capture chip / driver combination you have a certain "capture window". The real world consequence is that horizontally you will end up with a few too much or too little pixels which have been captured. There are several methods to correct this error, I used a trial and error approach.
In chapter 10 of the Doom9 capture guide you will find a link to some test videos by Arachnotron. Download the one that applies to you (NTSC DVD). Burn a DVD from this downoaded file and play it in your standalone DVD player. Don't worry about the vertical dimension, we are only interested in the horizontal part. The DVD has 720 pixels horizontally, but you will see only a part of them on your TV set. Have a close look at your TV screen and note the number of pixels you can actually see horizontally. Probably around 680 pixels.
Now connect the analog output of your DVD player to the input of your capture card and capture a minute or two at 720 x 480. Encode and burn a DVD. Now play this DVD and count the number of horizontal pixels on your TV. If they are the same as from the original DVD you are very lucky. But most likely there will be a difference.
Ok, I tried this. I followed the directions exactly as shown in the capture guide and you'd never believe it, but mine was perfect.
On the left I had 20.5 and on the right I had 18.5.
720 - 20.5 - 18.5 = 681
Without going through the rest of the math, that turns out to be 1:1 exactly. So I guess this combination of card and driver is working well. I described in detail what I'm using in the first post in this thread.
But, the directions you mentioned are different than those in the guide. Have to looked at the guide lately? They do not talk about using a real TV at all or reburning the test caputure. So hopefully my results are correct. But I did follow the directions in the capture guide.
If you want me to post a frame of my captured test video I can. Just let me know.
Thanks!
puddy
puddy
27th March 2007, 03:45
Can you please post the QuEnc settings you used, mainly the settings under the "Advanced" tab?
Sure... here ya go:
BASIC:
QuEnc Version: .72
Codec: MPEG-2
Bitrate: 9624
Use VBR: Unchecked
High Quality: Unchecked
Use Trellis Quant: Unchecked
2 Pass Encoding: Unchecked
ADVANCED:
"Extreme & Slow": Unchecked
GOP Size: 18 (Remember, I'm NTSC, so that should be ok)
Max B-Frames: 2
Force Closed GOP: CHECKED
4:3 Aspect Ratio
Mux Profile: DVD
Interlaced Encoding: CHECKED (my source is definitly interlaced)
DC Percision: 10 (picked 10 becsaue of high bitrate)
Top Field First: CHECKED
Pulldown: Unchecked
Auto Max Bitrate: Unchecked
Max Bitrate (kbps): 9800 (This was already in there and I didn't change it)
Use QLB Matrix: Unchecked
Audio Codec: AC3
Audio Bitrate (kbps): 384
So there ya go... encode still took something like 2 hours for 1 hour of video and the lower quality encode was instantly noticable played back using Media Player Classic (MPC).
manolito
27th March 2007, 20:36
Your settings all look OK to me. The only thing that might improve quality is to use a smaller GOP size like 12. More I-Frames use up more bitrate, though.
How exactly would you characterize QuEnc's lower quality? Loss of detail in high motion / complicated scenes? Blockiness in static scenes? Dotcrawl in dark surfaces?
You probably should experiment with different matrices a little. QuEnc does not have a feature like HC's adaptive matrix feature, but you could select a matrix which deliberately takes away some bitrate from complicated / high detail / high motion scenes and gives those bits to static scenes instead. Keep in mind that SVHS has a maximum horizontal resolution of about 400 lines, so the high detail present in good DVDs is not there in your source from the beginning.
HC comes with a huge selection of matrix files, and QuEnc supports this format right out of the box, no conversion required. Cut out a small 1 minute clip from your source where the quality difference is visible most, and do a little test series with different matrices. And try to compare the results on your TV, not on the computer.
Good luck
manolito
puddy
20th April 2007, 16:36
Your settings all look OK to me. The only thing that might improve quality is to use a smaller GOP size like 12. More I-Frames use up more bitrate, though.
Really? I thought it was just the opposite that setting the GOP higher resulted in slightly better quality.
How exactly would you characterize QuEnc's lower quality? Loss of detail in high motion / complicated scenes? Blockiness in static scenes? Dotcrawl in dark surfaces?
Basically all of the above, really looked quite bad.
For now I think I'll stick with HCEnc, but thank you for these suggestions.
puddy
puddy
20th April 2007, 16:51
But, the directions you mentioned are different than those in the guide. Have to looked at the guide lately? They do not talk about using a real TV at all or reburning the test caputure. So hopefully my results are correct. But I did follow the directions in the capture guide.
Just wondering if you took a look at the directions actually laid out in the guide and compared them to the method you described? Do you think it is really possible my chipset / driver combo is perfect?
Thanks again!
puddy
FredThompson
21st April 2007, 23:08
IMNSHO, using a TV to compare the aspect ratio or chroma is a waste of time. TVs are not calibrated display devices. This, and the fact that human percepetion of color changes all the time, are why the guide doesn't recommend using a TV to verify editing.
DV camcorders are quite cheap now. Have you considered one of them with firewire output? Your current process is AAD. It can't compare in quality to DDD (to use the audio CD terminology...)
Here's what I use to clean NTSC DV.AVISource("EM Mechanical Service Camera 2.avi")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DeGrainMedian.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\EEDI2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\medianblur.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MVTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ReduceFlicker.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainS.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RepairS.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SSEToolsS.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\DeHalo_alpha.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\LRemoveDust.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\MCBob.avs")
ConvertToYV12(Interlaced=True)
SeparateFields()
DeGrainMedian(limitY=2,limitUV=3,mode=3,interlaced=true)
evn=SelectEven().DeHalo_Alpha().LRemoveDust_YV12(10,1)
odd=SelectOdd().Dehalo_alpha().LRemoveDust_YV12(10,1)
Interleave(evn,odd)
weave()
GetParity() ? nop() : DoubleWeave().SelectOdd()
# Deinterlace
#MCBob().SelectEven()
The DeGrain, LRemoveDust and MCBob calls are optional. The first 2 help to remove noise. MCBob is used to deinterlace if the target is PC playback. It's slooooooooow but the only thing I've found which makes acceptable deinterlaced NTSC DV.
IIRC, Hi8
Well, my AviSynth and encode process sure have gone through a lot of changes. I've really learned a lot about dealing with interlaced video. Here's my latest and greatest AviSynth script. I get about 6fps out of it, which is workable. Just so you aren't confused, in this particular script I'm taking letterboxed 4:3 video (mostly pre-cropped during capture) and turning it into 16:9 anamorphic.
Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
AviSource("disney.avi")
Crop(0,2,0,-8,True)
ConvertToYV12(interlaced=true)
yadif(mode=1,order=1)
HDRAGC(coef_gain=.5,max_gain=.8,min_gain=0,black_clip=.1,reducer=2)
Deen("a2d",2,10,12)
FFT3DGPU(sigma=3, bt=3, bw=32, bh=32, ow=16, oh=16, sharpen=0.5)
LanczosResize(704,480)
assumetff()
separatefields().selectevery(4,0,3).weave()
AddBorders(8, 0, 8, 0, $000000)
FadeIn2(55)
FadeIo2(55)
One of the biggest things I've learned is that it really is OK to deinterlace using a good plugin, filter, resize, then reinterlace. In fact it seems to be the best way to do it. If you do it the way a lot of people suggest using separatefields & weave only it introduces a slight misalignment of the fields (might not be the best way to describe it) but I can clearly see the difference. This new way is MUCH, MUCH nicer. The incredible yadif deinterlace plugin makes it possible without slowing you down to a crawl.
And here are my current HC Encoder parameters (now using HC Encoder v0.21):
*BITRATE 8691
*MAXBITRATE 9624
*FRAMES 0 122880
*PROFILE best
*AUTOGOP 18
*DC_PREC 10
*INTERLACED
*TFF
*CLOSEDGOPS
*BIAS 5
*MASK_SHIFT 2 2 0
*MATRIX mpeg
I'm still looking for better speed and quality wherever I can find it.
Here are some interesting threads I've been reading where I picked up a lot of what has gone into my latest script:
Port of MPlayer Yadif deinterlace filter (Fast & high quality):
http://forum.doom9.org/showthread.php?p=1001321
FFT3DFilter - 3D Frequency Domain filter-denoiser (This is slow, but awesome.):
http://forum.doom9.org/showthread.php?p=573156
fft3dGPU (Use this instead of FFT3DFilter if your video card supports it, very interesting stuff!)
http://forum.doom9.org/showthread.php?p=610163
HDR AGC (Thanks Blue_MiSfit for the suggestion above - this makes your cam videos look so nice.)
http://strony.aster.pl/paviko/
I've also put more and better RAM in my machine but I didn't see much speed boost at all. My specs are in my sig now and I finally got an avatar! ;)
puddy
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.