Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Sep 2012
Posts: 19
|
Removing duplicate frames (16->24 fps)
Hi there,
I have telecined HD silent 16mm film footage that was scanned at 16fps and output into a 24fps file. The pulldown pattern is ABCCABCCABCC. Can someone provide a precise AVISynth script, using whatever available internal or external plugins exist, that when I open the .avs file in virtualdub I will be left with only unique frames. Thanks for your help, |
![]() |
![]() |
![]() |
#2 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,222
|
Quote:
Maybe my math is wrong, but something doesn't add up. If it's 16fps => 24fps , but your pattern suggests removing 1 of every 4. That would suggest 18fps (0.75 * 24 = 18), or was there a speed change as well? For straight 1 of 4 decimation you can use TDecimate(mode=0, CycleR=1, Cycle=4) . Have a look at the documentation for adjusting the other parameters |
|
![]() |
![]() |
![]() |
#4 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,698
|
If you are intending to try Multidecimate, then you might be interested in MDec2(), a mod of FDecimate() metrics
but acting much like the Multidecimate() filter. Requires MultiDecimate.Exe & ProcessMD.Exe from MultiDecimate package, here: http://forum.doom9.org/showthread.ph...22#post1639822 Multidecimate YUY2() only, MDec2 v2.5 and v2.6 dll's, Planar, YUY2, RGB24/32.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 11th December 2013 at 18:58. |
![]() |
![]() |
![]() |
#6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,698
|
I did fix what I thought was a bug in FDecimate metrics, but not offhand sure exactly what it was.
I still prefer Multidecimate/MDec2 in preference to other decimators due to two pass with all metrics simultaneously available for 2nd pass. Find it particularly preferable if fixing a clip with multiple issues, where can do 1st pass only once and then can play with additional filters to your hearts content without incurring decimate detection overhead whilst trying to find optimum correction settings. Never did get to see the source though, as not released, I think, same for Multidecimate.Exe and ProcessMD.Exe. On second thoughts, I think you did metrics in frame strips skipping some of the frame and think that it got 'out of whack' for chroma metrics, adding chroma metrics to wrong BLOCK. I modded to examine entire frame, and corrected what I thought was the error. You are welcome to take what I've done and mod it further, would be very happy to try out new 1 pass multidecimate. ![]() EDIT: MDec2(), Metrics for Planar (v2.6 compatible) Code:
// Below, Luma *2 as luma counts 50%, same as combined chroma (U+V) [maintain precision]. if(vi.IsPlanar()) { for (y = 0; y < height; ++y) { for (x = 0; x < row_size;++x) { sum[(y/BLKSIZE)*xblocks+x/BLKSIZE] += abs((int)currp[x] - (int)prevp[x]) * 2; } prevp += pitch; currp += pitch; } if (color) { prevpU = prev->GetReadPtr(PLANAR_U); currpU = curr->GetReadPtr(PLANAR_U); prevpV = prev->GetReadPtr(PLANAR_V); currpV = curr->GetReadPtr(PLANAR_V); for (y = 0; y < heightUV; ++y) { for (x = 0; x < row_sizeUV; ++x) { int sm = abs((int)currpU[x] - (int)prevpU[x]); sm += abs((int)currpV[x] - (int)prevpV[x]); sum[((ySubS*y)/BLKSIZE)*xblocks+(xSubS*x)/BLKSIZE] += sm * tSubS; } prevpU += pitchUV; currpU += pitchUV; prevpV += pitchUV; currpV += pitchUV; } } } Code:
int xSubS =1; int ySubS =1; int tSubS =1; bool color = (chroma); if (vi.IsPlanar()) { row_sizeUV = curr->GetRowSize(PLANAR_U); if(color && row_sizeUV>0) { pitchUV = curr->GetPitch(PLANAR_U); heightUV = curr->GetHeight(PLANAR_U); xSubS=row_size / row_sizeUV; ySubS=height / heightUV; tSubS = xSubS * ySubS; } else { color=false; } }
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 19th September 2013 at 16:41. Reason: additional |
![]() |
![]() |
![]() |
#7 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,635
|
I do this all the time, both with 16 fps and 18 fps telecined film. Here is the script I use. I'm sure you can adapt it to your needs. Make sure to set BFF/TFF to match your source material. I have included a commented out line for 18 fps material, in case you ever need to do that. Also, if the tdecimate settings don't work on your material, you can try one of the other modes, or play with the cycleR and cycle settings.
[edit]If the pulldown pattern extends over more than a few fields, you can try using multiples of the cycle settings, e.g., cycleR=4, cycle=6; or cycleR=6, cycle=9. Also, do NOT use SetMTMode with this script. Finally, take note of the last three lines. I always temporarily enable the "separatefields()" statement at the end of the script and step through a few hundred frames throughout the source material. You should get two matching fields, with nothing more than a little up/down motion (from the spatial separation between fields). You should not see any horizontal motion and you should not see any blended fields, if the script is working correctly. Once you have done this, remove the separatefields() statement and proceed. Code:
# Script to IVTC an 8mm movie. loadPlugin("c:\Program Files\AviSynth 2.5\plugins\TIVTC.dll") AVISource("e:\fs.avi").killaudio() AssumeBFF() tfm(display=false) #tdecimate(display=false,mode=0,cycleR=2,cycle=5) #18 fps # 3:3:4 field count tdecimate(display=false,mode=0,cycleR=2,cycle=3) #16 fps #AssumeFPS(18) AssumeFPS(16) #Uncommend this field in order to check that IVTC is being performed correctly. #Put back the comment before doing the actual IVTC #separatefields() Last edited by johnmeyer; 19th September 2013 at 20:13. Reason: added advice about using multiples of cycle and cycleR |
![]() |
![]() |
![]() |
Tags |
avisynth, duplicate frames, film, inverse telecine, pulldown |
Thread Tools | Search this Thread |
Display Modes | |
|
|