Been encoding with TMPGEnc for years but I'm an Avisynth newbie.
I'd like to take episodes of Battlestar Galactica (captured from the SciFi Channel with my Canopus ADVC-100 as DV video), crop the black bars off the top and bottom, IVTC from 29.97 down to 23.96fps, and encode as 720x480p 16x9 mpeg-2 with pulldown for authoring DVD's.
I've written the following script (with help from the nwgat scripts for HD TS streams and also from The FilmMachine's avs files):
# 16:9 encoding for 4x3 letterboxed DV Film source
# PLUGINS
#LoadPlugin("C:\Program Files\Avisynth 2.5\plugins\Decomb521.dll")
#LoadPlugin("C:\Program Files\DGIndex\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TIVTC\TIVTC.dll")
# SOURCE
AviSource("K:\Media\Double Feature.avi", false)
ConvertToYV12()
# IVTC TIVTC
#Use this section if source is FILM
tfm().tdecimate()
# DEINTERLACE
#Use this section if source is interlaced VIDEO
#FieldDeinterlace()
# CROPPING AND RESIZING
#Use this section only if source is letterboxed 4x3
Crop(0,60,720,360)
Lanczos4Resize(720,480,0.0,0.6)
(The above has now been edited to correct the YV12 mistake I discovered in my next post, "rem" out loading the DGIndex plugin, and remove the fadein line entirely)
I figure I'll load this script into QuEnc, HC, or one of the other freeware mpeg-2 encoders that can accept avs scripts.
Can any of you avisynth experts see any glaring errors in my script or my method in general before I get started?
Thanks....
+ Reply to Thread
Results 1 to 9 of 9
-
-
Discovered my first error already...
Gave it a test shot with a 30 second commercial for one of the SciFi Channel's trashy "SciFi Original motion pictures" which was also letterboxed.
Found I had to move the ConvertToYV12 line above the IVTC section, otherwise QuEnc puked on loading the avs file.
Then, QuEnc had the "pulldown" option greyed out so I had to do a straight 23.976fps encode. Any idea why I couldn't apply pulldown?
I fed the same script into TMPGEnc Plus and was able to select pulldown with no problem. Better PQ on TMPGEnc's output m2v file also.
Thanks.... -
I don't yet consider myself an expert at avisynth, but I've been using it for a while and hope I can help.
Are you capturing to Type1 or Type2 DV-AVI?
I don't get SciFi, is the program broken up by commercials? And do you want to remove them?
Is the Telecine consistant throughout? Many sci fi shows (and others) are telecined before editing causing inconsistant telecine patterns that can be difficult to remove.
How are you handling audio? QuEnc can encode the audio to AC3 directly from the avs script if you include it.
I would consider 50 frames to be a pretty long FadeIn. Do you have enough waste leadin material to absorb it?
I don't see why you're loading the DGIndex plugin, but it shouldn't cause any harm.
I would move the ConvertToYV12 to the last line of the script to maintain the same colorspace throughout the filtering, but I don't know that it makes any difference as you will still only have the one colorspace conversion.
Edit: I see your comment about needing ConvertToYV12 before IVTC. I don't have that filter, but it sounds like it requires the YV12 colorspace."Shut up Wesley!" -- Captain Jean-Luc Picard
Buy My Books -
Hi Gadgetguy,
The program is aired with commercials, but my plan is to edit them out with VirtualDub, using direct stream copy, before encoding.
Type 2 DV AVI.
VirtualDub will also separate the audio before I start encoding, so I can add it back for the DVD authoring stage.
That fadein(50) line came verbatim from The FilmMachine's template. I take it I should lower that or eliminate it entirely?
I loaded the DGIndex plugin because the nwgat scripts (for converting 29.97fps TS streams to 23.976 x264 mkv files) use it. Figured similar frame rate conversion needed similar filter. If it's not necessary here, I won't load it. Should I delete that line?
Thanks! -
Using VirtualDub in the encode path will slow encoding down considerably. Using the Trim command in AviSynth is faster and including the audio in the AviSynth script will maintain the A/V synch during the cuts. I use Vdub as the front end to find my Trim points, but not during the encode process. Some people use VdubMod to edit the script with the trim points, but I find editing the avs directly is simple enough.
Type 2 audio works well with AviSynth and as long as you don't have any synch issues using Type2 it's the way to go. Unfortunately, I have synch issues capsferring to Type2 so I use Type1 but have to extract the audio to wav and load it separately in the script.
50 frames is nearly 2 seconds which is about four times longer than I would normally set for fadein. I usually don't use fadein at all since most programs have fadein built in when they cut to and from commercial.
I don't see anything in your script that accesses DGIndex which is usually used to access Mpeg files. Since it's not needed, I would remove the line so it is not loaded into memory. Probably won't make any noticable difference, but I'd remove it just the same.
I also wouldn't bother with Inverse Telecine. As I said earlier, it usually doesn't work too well because the pattern is usually not consistant and since most programs are only about 43 minutes long the savings you can achieve by IVTC are not necessary to still be able to encode at high bitrates. Just encode it as interlaced."Shut up Wesley!" -- Captain Jean-Luc Picard
Buy My Books -
I commented out the DGIndex line and nothing bad happened, so I guess I'll remove it entirely.
I'm not actually using Vdub in the encode path.... just using it to cut the commercials out and separate the WAV file before starting the encode in the first place. I then put the edited AVI file into the AVS script.
Good point about the fadein, it's gone from here on out.
The inverse telecine works great when I convert 29.97fps 1080i TS streams to 720p 23.976fps x264 streams, so I'm still gonna give it a shot here and see what happens. After all, it's only CPU cycles, right?
And rather than load the script into one of the freeware encoders, I'll load it nito TMPGEnc...since I paid for TMPGEnc years ago and it's picture quality is much better than QuEnc in the a/b test I did earlier today (same clip, same bitrates, etc)....
Update: TMPGEnc is encoding an episode from the script as we speak. Looks like it will be as slow, maybe even a little slower, than when I did all this stuff in TMPGEnc itself. But now that I have the script written, it involves a LOT less "hands on" on my part each time I want to do an encode.
Thanks! -
Creating the interim avi seems like extra work/time to me, but it's certainly a useable workflow.
If the telecine pattern is consistant then you should get good results with IVTC, as you said it's worth a try.
I actually came to the opposite conclusion when I did my comparison between TMPGEnc and QuEnc, but hey, you're not making these for me so use what works for you.
Edit: Actually I forgot you want to encode these as 16:9. IVTC/Deinterlace is really necessary since you are cropping and resizing. I hope it has a decent pattern."Shut up Wesley!" -- Captain Jean-Luc Picard
Buy My Books -
-
I believe HC and QuEnc are based on the same engine (libavcodec). But I don't think HC does audio. I've read comments about FreeEnc being buggy, but I don't have any first hand knowledge. I've been happy with QuEnc. The only encoder I've tested that I thought was noticably better was MCC, but for me, it wasn't enough to justify paying the cost difference.
"Shut up Wesley!" -- Captain Jean-Luc Picard
Buy My Books
Similar Threads
-
Should i use and avisynth script for Dv ?
By smartel in forum Newbie / General discussionsReplies: 0Last Post: 10th Mar 2012, 08:29 -
Need Help with My AviSynth Script
By Enkidu in forum Newbie / General discussionsReplies: 3Last Post: 21st Jan 2011, 21:37 -
Avisynth Script Help
By jamhat in forum Video ConversionReplies: 2Last Post: 29th Nov 2009, 06:13 -
Avisynth script
By daz2712 in forum Video ConversionReplies: 2Last Post: 19th Aug 2009, 11:08 -
avisynth script
By magenta2007 in forum SVCD2DVD & VOB2MPGReplies: 7Last Post: 25th Sep 2007, 11:29