I'm somewhat new to video conversion so bear with me.
Most 1920x1080i .ts files I have are around 110,000 frames for a 1 hour segment at NTSC 29.97fps. However, sometimes I get ones that come out as closer to 140,000 frames for the same 1 hour, and mediainfo still reports it at 29.97fps. Does this have something to do with pulldowns? How do I bring this video and its audio into avisynth, trim pieces of it, resize it, and convert it to AVC while making sure the audio syncs with the video? My steps so far:
1. Demux .ts to .mpv and .ac3
2. index .mpv with DGIndexNV
3. Create avisynth script something like this:
============
4. Import AVS into MeGUI for both video and audio conversion.Code:LoadPlugin("C:\program files (x86)\dgdecnv2039\DGDecodeNV.dll") LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll") video=DGMultiSource("S:\EXAMPLE.dgi") audio=nicac3source("S:\ORIG.ac3") #<SPLIT> clip1=AudioDub(video,audio) clip2=clip1 clip3=clip1 clip4=clip1 clip5=clip1 clip6=clip1 #<TRIM> clip1=clip1.Trim(320,17549) clip2=clip2.Trim(21765,36245) clip3=clip3.Trim(45056,57253) clip4=clip4.Trim(60780,71759) clip5=clip4.Trim(75141,89370) clip6=clip5.Trim(94478,108780) #<DEINTERLACE> clip1=clip1.AssumeBFF().Yadif(1,1) clip2=clip2.AssumeBFF().Yadif(1,1) clip3=clip3.AssumeBFF().Yadif(1,1) clip4=clip4.AssumeBFF().Yadif(1,1) clip5=clip5.AssumeBFF().Yadif(1,1) clip6=clip6.AssumeBFF().Yadif(1,1) #<CONCATINATE> final=AlignedSplice(clip1, clip2, clip3, clip4, clip5, clip6) #<RESIZE> final=final.Lanczos4Resize(1280,720) #SelectEven() to fix the frame doubling that Yadif did final=final.SelectEven() return(final)
5. Remux results into mkv
I've been looking around about pulldowns, and I'm not really understanding it. The way the video is, it would have to play at 39fps to get all of those 140,000 frames into 1 hour. I thought a pulldown pushed 24fps to 29.97. So what is going on here, and how do I deal with the extra 30,000 frames?
BONUS:
I'm using Lanczos4Resize() to go from full 1080 to 720; is there a better resize algorithm for making video smaller? I hear the Lanczos4 is great for enlarging, but I don't know about shrinking.
BONUS 2:
Is there a better deinterlacer than Yadif that doesn't take a huge amount of time? I know about QTGMC but that takes WAY too long. How about a good deblocker?
+ Reply to Thread
Results 1 to 8 of 8
-
-
Yes. What are these, television broadcasts?
How do I bring this video and its audio into avisynth, trim pieces of it, resize it, and convert it to AVC while making sure the audio syncs with the video?
There's something wrong with the framecounts, though, because at 30fps there are a total of 108000 frames in an hour long video. I don't know where that 140000 figure comes from. Maybe MediaInfo is screwing up. What does GSpot say? Please provide short samples of both kinds.
Only deinterlace the ones shot on video (that used interlaced 29.97fps cameras). Those will have every frame interlaced. The ones shot on film with pulldown applied should be IVTC'd (using TIVTC). You can spot them because only 2 of every 5 frames will be interlaced.
Your script is very awkward and inefficient, but should work, I guess. I'm not sure why you're using Yadif's bob mode followed by a SelectEven at the end. Why not just do a single-rate deinterlace to begin with? The resulting quality will be better. And, in my opinion, Yadif if the fastest decent deinterlacer. The better ones take more time, as you discovered.
When lowering the resolution I just use plain old LanczosResize. Others have their own favorites. -
Okay, so I figured out where the 140,000 came from, but not why. When DGDecNV indexes the mpv file, it "codes" only the original 24fps frames (~86,000 for 1 hour), but has "playback" list all 108,000 frames (1 hour at 29.97fps). It then also lists the "field rpts" as 22,000. Sounds good. However, once I load the dgi file into avisynth, for some reason it ADDS the field rpts to the original 108,000 frames for a total of over 130,000. That's obviously incorrect. The solution I found was to use DGMPGDec instead of DGDecNV. The resulting d2v file, when loaded into avisynth, has the correct number of frames.
I've also done my trimming before any indexing, so this eliminates all video.Trim() lines in my code, as well as all audiodubbing and the AlignedSplice(). Much cleaner. However, I still have to use Yadif, so I'm wondering how I'm supposed to do a single-rate deinterlace with Yadif. How would you do it without having to use SelectEven()?
Thanks for the help! -
Code:
#<DEINTERLACE> clip1=clip1.Yadif() clip2=clip2.Yadif() clip3=clip3.Yadif() clip4=clip4.Yadif() clip5=clip5.Yadif() clip6=clip6.Yadif()
-
Okay, I'm going to go with clip.Yadif(0,1) and no SelectEven(). I need to be able to tell Yadif whether it's TFF or BFF, as the streams I work with vary. Thanks for the help.
Yes, I tried MeGUI's AVS Script Creator, and it set everything up okay, but after it completed the first job (index the stream), the program crashed. It seems to do that with all of the streams I throw at it. The way I've figured out to do it is pretty much what MeGUI would do, I just have to do it a bit more manually. Thanks! -
Yes, I tried MeGUI's AVS Script Creator, and it set everything up okay, but after it completed the first job (index the stream), the program crashed. It seems to do that with all of the streams I throw at it. The way I've figured out to do it is pretty much what MeGUI would do, I just have to do it a bit more manually. Thanks![/QUOTE]
Interesting. The only trouble I've ever had while using the script creator was that it can never seem to nail down ABC's pulldown scheme, since they play all those tricks with the video signal. I've only been able to do it once. All other times, I've just set it on the "m-In-5 decimation", and set the number to 3 and add TDecimate (?)
I rely on it almost exclusively now. I even used it for a while to feed TMPGEnc because their pulldown routine is kinda confusing for me to configure.
I might have missed it before, but what kind of streams are you converting? -
Guest34343Guest