Quantcast Avisynth: Finally, the Perfect Script for Analog TV - digitalFAQ.com Forums [Archives]
  #1  
06-08-2003, 04:01 PM
Grantman Grantman is offline
Free Member
 
Join Date: Sep 2002
Location: Northfield, IL
Posts: 102
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Grantman Send a message via AIM to Grantman Send a message via MSN to Grantman Send a message via Yahoo to Grantman
OK... I think I have finally devised the perfect script. The plan was to create ONE script that could be used relatively well for any type of program captured from television. This means cartoons, movies, programs....

The captures are all coming from ReplayTV. They are 720x480 Interlaced NTSC analog cable source. The MPEG files are a constant bit rate and a slightly strange MPEG source.

DVD2AVI works great and then I take my .dv2 file and use Movie Stacker to take it to 480 x 480. (I am using the KVCD3 template). 352 to too dull and 528 does not buy any extra quality I can see.

Here is the fun part. This is the script I have come up with: :P

LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\MPE G2Dec3.dll")
LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\Dec ombLegacy.dll")
LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\Gri pFit_preview.dll")
LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\Blo ckBuster.dll")
LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\Dus tV5.dll")
LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\Leg alClip.dll")
LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\Cnr 2.dll")
LoadPlugin("C:\KVCD\Versions\AviSynth2\plugins\STM edianFilter.dll")

Mpeg2Source("xxxx.d2v")
LegalClip()
FieldDeinterlace()
Cnr2()
GripCrop(480, 480, overscan=2, source_anamorphic=false)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0, 8, 32)
PixieDust()
BlockBuster(method="noise", detail_max=7, variance=0.5, seed=1)
GripBorders()
LegalClip()

I am not making it up when I say I have invested over 100 man hours tweaking and testing. I have gone through 200 CD-Rs. (My girfriend is sick of my floor being covered with test VCDs).

I have tested each filter in different places in the script and I have taken most of my ideas from KWAG!!!!, the AVISYNTH site and the DOOM9 formus. (I am not nearly as smart as those guys!).

This is not the fastest script. On my Athlon 2200+ (1GB RAM) it takes about 90-100 minutes per 30 minute show.

But the results are excellent. The original captures are a little noisy. An Episode of The Simpsons I did last night looks better than when it was on the first time. I did several episodes of "Good Eats" off Food TV and the only problem was when there is significant amounts of bright white text on the screen there is a bit of noise or shadowing around it. Nothing to complain about.

The file sizes are very small. I am able to get 80 minutes of The Simpsons 60 minutes of Good Eats on a VCD with plenty of room for other fun files and clips (for my interactive menus).

Next I am testing Hi8 captures. If those work too...

I could not be any happier. Thanks to all for the massive amount of help.

(Of couse I am NEVER above more suggestions).

The reason I strayed away from the current optimal scripts was they were a little too blurry on my 35" Sony Trinitron. It is not HDTV and the source is not sharp enough to handle the extra smoothing.

Grantman

P.S. Thank You, Thank You, Thank You, Thank You, KWAG! A quick count showed more than 20 posts you answered or added to for me that basically gave me the info I needed. Then... last night I came across a post from JAN 2003 where you SansGrip were testing Dust and Temporal Smoother.

http://www.kvcd.net/forum/viewtopic....g2dec3&start=0

That did it. The final piece was in place. As Mr. Burns would say:

"EXCELLENT!"
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
06-08-2003, 05:15 PM
Grantman Grantman is offline
Free Member
 
Join Date: Sep 2002
Location: Northfield, IL
Posts: 102
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Grantman Send a message via AIM to Grantman Send a message via MSN to Grantman Send a message via Yahoo to Grantman
I just found this about the specific attributes of the MPEG files you can download from a ReplayTV box:

QualitySetting (Resolution) - (Video Bitrate) - (Audio Bitrate)
High (720x480) - (9Mbps VBR) - (192 kbps)
Medium (720x480) - (7Mbps VBR) - (192 kbps)
Standard/Extended (352x480) - (2MBps VBR) - (192 kbps)

System Stream Type Program
Video Standard NTSC
Video Compression MPEG-2
Video Bitrates (see above)
Resolution (see above)
Frame Rate 29.97 fps
Drop Frame Flag Not Set
Constrained No
IQ Matrix False
Non-IQ Matrix False
Aspect Ratio (Standard) 4:3 (640x480)
Aspect Ratio (High/Medium) 4:3 (720x540)
Sequence Format Interlaced
Field Order A (top first)
Chroma Format 4:2:0
Profile/Level MP@ML
Color Primaries SMPTE 170M
Transfer SMPTE 170M
Matrix SMPTE 170M
Quantizer Scanning Pattern alternate
Quantizer Scale 1
Intra DC Precision 8
Intra VLC Format 0
Audio Compression MPEG-1 Layer 2
Audio Stream Stereo, 48kHz
Audio Bitrates (see above)
Frame Length 24.0 ms (576 bytes)
VBV Buffer 112 / 224
VBV Delay 65535
Minimum Buffer Size 229376 bytes

MUX Rates
All measurements are bits per second

QualitySetting (System) - (Video) - (Audio)
Standard (2028400) - (1726000) - (192000)
Medium (7680800) - (7413200) - (192000)
High (3332400) - (9800000) - (192000)


If you have a ReplayTV and are trying to use the KVCD templates this info can be helpful.

Grantman
Reply With Quote
  #3  
06-12-2003, 12:01 PM
MrTibs MrTibs is offline
Free Member
 
Join Date: Aug 2002
Location: Canada
Posts: 200
Thanks: 0
Thanked 0 Times in 0 Posts
Do you think you could post a before and after shot? I'd like to see a source frame and the same frame after VCD encoding. BTW, what are your TMPGEnc setting?
Reply With Quote
  #4  
06-14-2003, 04:57 PM
Grantman Grantman is offline
Free Member
 
Join Date: Sep 2002
Location: Northfield, IL
Posts: 102
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Grantman Send a message via AIM to Grantman Send a message via MSN to Grantman Send a message via Yahoo to Grantman
Can I embed a screen capture or do I have to reference it and actually store it some place else?

Grantman
Reply With Quote
  #5  
06-14-2003, 04:57 PM
Grantman Grantman is offline
Free Member
 
Join Date: Sep 2002
Location: Northfield, IL
Posts: 102
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Grantman Send a message via AIM to Grantman Send a message via MSN to Grantman Send a message via Yahoo to Grantman
A before shot is not so useful because the main issue is size not quality. If I could use the files "as is" from the ReplayTV I would do that. However, I want to put them on a CD-R and the files are 1.2GB per 30 minutes.

The TMPGEnc settings are exactly what the KVCD3 template sets. The only changes I make are to increase the audio 150%. (I encode the audio in TMPGEnc). I also change the frame rate to 29.97.

The results are usually 60-90 minutes per CD-R. That is enough for 3-4 30 minute shows (minus commercials which I trim out with TMPGEnc using CUT editing).

Grantman
Reply With Quote
  #6  
06-14-2003, 05:20 PM
BlueBeard BlueBeard is offline
Free Member
 
Join Date: Mar 2003
Location: Chesterfield, Michigan, USA
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
I too use ReplayTV files. I'm curious, what do you use for editting the commercials and have you had any audio sync problems?

Just reread your post and see that you use TMPGEnc to edit.
Reply With Quote
  #7  
06-16-2003, 02:17 PM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
I have one question, this script for wdm drivers cause I spot a d2v file as the source.
Reply With Quote
  #8  
06-17-2003, 06:35 PM
Grantman Grantman is offline
Free Member
 
Join Date: Sep 2002
Location: Northfield, IL
Posts: 102
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Grantman Send a message via AIM to Grantman Send a message via MSN to Grantman Send a message via Yahoo to Grantman
The D2V file comes from using DVD2AVI to separate audio/video. I create a project (*.d2v) and an audio file. The audio file has a number in the title of the file that represents the audio delay. (Don't ask me why but when recording on HIGH quality with ReplayTV there is a known offset between audio and video).

IN TMPGEnc under the ADVANCED tab there is a check box for SOURCE RANGE. When you open up that option there is a field called AUDIO GAP CORRECT. Plug the number in from the audio file you created with DVD2AVI.

For commericals I find the START frame and then the END frame for each commercial block. Then select CUT EDITING and CUT CURRENTLY SELECTED AREA. Each time you do this it removes the block of commercials from your output file. (Also it stops TMPGEnc from having to work on the commercials which speeds up the time).


Grantman
Reply With Quote
  #9  
06-17-2003, 06:39 PM
Grantman Grantman is offline
Free Member
 
Join Date: Sep 2002
Location: Northfield, IL
Posts: 102
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Grantman Send a message via AIM to Grantman Send a message via MSN to Grantman Send a message via Yahoo to Grantman
I have just run some tests using the Optimal Script from this forum with Avisynth 2.52.

It was a little larger file size for a 21 minute TV program. (270MB vs 255MB). However only too 40 minutes to encode vs. 125 minutes. Also, the picture quality was the same or better except around "on screen" graphics or letters. The program had information displaying in a bright white lettering and there was noise and blocks around it.

I was only using a CQ of 52 in hopes of getting 3 of these 21 minute clips on 1 CD-R. It is not as bad with a higher CQ but I am hoping to find a filter to clean up and give a little more compression.

I really wish there was a Dust for 2.5?


Grantman
Reply With Quote
  #10  
06-18-2003, 11:19 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
Quote:
Originally Posted by Grantman
The D2V file comes from using DVD2AVI to separate audio/video. I create a project (*.d2v) and an audio file. The audio file has a number in the title of the file that represents the audio delay. (Don't ask me why but when recording on HIGH quality with ReplayTV there is a known offset between audio and video).

IN TMPGEnc under the ADVANCED tab there is a check box for SOURCE RANGE. When you open up that option there is a field called AUDIO GAP CORRECT. Plug the number in from the audio file you created with DVD2AVI.

For commericals I find the START frame and then the END frame for each commercial block. Then select CUT EDITING and CUT CURRENTLY SELECTED AREA. Each time you do this it removes the block of commercials from your output file. (Also it stops TMPGEnc from having to work on the commercials which speeds up the time).
I know how to do all that, what I should of been clear about is, is the source your using a captured mpg file or a captured avi file?? I only ask cause of the d2v as source in script.
Reply With Quote
  #11  
06-19-2003, 01:20 PM
Grantman Grantman is offline
Free Member
 
Join Date: Sep 2002
Location: Northfield, IL
Posts: 102
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Grantman Send a message via AIM to Grantman Send a message via MSN to Grantman Send a message via Yahoo to Grantman
There are 3 basic sources I work with:

1) ReplayTV
2) DVD
3) DivX

The DivX is really just for messing around.

Most of my projects are using an MPEG2 file pulled off my ReplayTV DVR device. It is an MPEG2 with a constant bitrate of 9800.

I use DVD2AVI to create a project file for a couple of reasons. One, the source MPEG2 is not useable in many tools as is. Two, there is a known audio sync issue when using the video/audio streams from these files. (The ReplayTV box must automaticall account for this?!)

When I have the WAV file from DVD2AVI is has the audio offset listed in the file name. I can plug that into TMPGEnc and the sync is perfect.

I use the DV2 file in an Avusynth script but I have also used it natively in TMPGEnc as well. I just prefer not resizing or filtering in TMPGEnc.

I also have worked with captured video. I still like using DVD2AVI because it give you several options. You can use a seperate audio encoder (like HeadAC3he). If you have the proper codecs installed you can use an MPEG1 or MPEG2 file as your video & audio source and skip many of the steps.... but it kinda defeats the point.

If you already have an MPEG file that you want to use as it then there is little point to recompressing it. It is ONLY a size issue you are better off chopping it into pieces. If you only recompress it without using any tools you will loose quite a bit of quality.

Back to the point. I have had significantly better results using the dv2 file in an Avisynth source than I have had using an MPEG file. If I am using a DivX file I just use it as is unless the audio is out of sync or in an incompatable format. Then I would create an uncompressed WAV in Avisynth but still use the original AVI as the video source in the script.


Grantman
Reply With Quote
  #12  
06-19-2003, 01:59 PM
Dano Dano is offline
Free Member
 
Join Date: Apr 2003
Location: Brockton, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
Sounds like you guys are open to trying some new stuff for analog caps. I have been using Virtual Vcr to cap tv episodes to Morgam MJpeg and have been messing around with diferent methods using the current 2.5 script. Anyways, what I have been trying lately is managing to get more bits per pixel without having to sacrifice sharpness. For tv caps I usually go for 1 disc per episode svcd encodes and decided it just wasn't quite there. Properly telecined shows are easily IVTC'd with telecide and decimate and there is a huge boost in bitrate savings. Well, to the point, I have been turning fullscreen caps into 2.35:1 aspect ratio letterbox and must say it looks pretty sweet. To do this I cap at 704 x 480 and add the following:

BicubicResize(704,300)
#
AddBorders(0,90,0,90)
#
Letterbox(90,90)

Some pseudo-widescreen shows are even better since you get to remove black borders that are worthles to encode anyways but the parameters have to be different. If you have a large screen tv (I have a 32", 35" and an Epson PJ hooked to a HTPC) you aren't bothered by the black borders terribly.

Cheers

-Dano
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
New domain KDVD.Net, finally ours! kwag Off-topic Lounge 0 02-11-2004 03:20 PM
Avisynth: Analog capture processing guide jorel Avisynth Scripting 0 04-15-2003 01:26 AM
Avisynth: Optimal Avs script for analog capture? Sergeiv Avisynth Scripting 6 04-11-2003 04:27 AM
Avisynth: Analog cable TV capture with minor interference noise? digitalize Avisynth Scripting 2 02-27-2003 11:31 AM
KVCD: Finally figured it out, and my audio/video is perfect! 1 CD! giant.robot Video Encoding and Conversion 5 10-25-2002 04:09 PM

Thread Tools



 
All times are GMT -5. The time now is 11:56 AM  —  vBulletin © Jelsoft Enterprises Ltd