The Avisynth wiki gives this example of how to use DeleteFrame:
Just what I need for an old film with a single splicemark frame at each scene change. But when looking at the preview of my script the splice marks were still there despite the fact that the framecount had gone down by the number of frames I wanted cut. So, to see what was happening, I scriptedCode:DeleteFrame(3, 9, 21, 42) # delete frames 3, 9, 21 and 42It returned a four frame clip comprising frames 5000-5003. The two final frames were cut.Code:trim(5000,5005).deleteframe(5002,5004)
What am I doing wrong? Thanks
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
In your example, the trim command makes the frame numbers no longer valid. There are new frame numbers after the Trim(), namely 0,1,2,3,4,5 , corresponding to 5000 to 5005. Any subsequent DeleteFrame call out of the new framenumber range (now 0 to 5) will now just delete frames from the end. So you would expect 5004,5005 to be deleted .
Use a frame accurate source filter
Post your script -
I do a lot of film work and often have to fix splices. While I generally find it easier to do this within Vegas, using Vegas scripts I have written to delete a frame, or replace it with a duplicate of the next or previous frame, I did write an AVISynth script to replace a bad frame at a scene change. Since splice marks always happen at a scene change (even if the splice was to repair broken film, because this usually creates a big enough jump to create a scene change), you may find this useful (or maybe you won't)
Code:#Script to replace frames at scene changes global scenethreshold=15 source=AVISource("E:\fs.avi").killaudio().convertTOYV12() # Temporarily un-comment next line to display the average luma value on screen to help determine threshold value #ScriptClip(source,"Subtitle(String(YDifferenceToNext(source) ))" ) fixed = ConditionalFilter(source, trim(source,1,0), source, "YDifferenceToNext()>scenethreshold", "greaterthan", "0") return fixed
-
Thanks, poison, I understand DeleteFrame now. Seems counterintuitive, in my view, though. Much easier, surely, to specify the rogue frames with their original numbers. What do you mean by a frame accurate source filter? (I get my frame numbers from the .showframenumber command.)
Thanks, John. I tried various ways of using your script but without success. How should I apply it to this, my standard way of scripting:
Code:LoadPlugin("D:\MeGUI 2944 32bit\tools\lsmash\LSMASHSource.dll") a=LWLibavVideoSource("D:\movie.avi") b=LWLibavaudioSource("D:\movie.avi") audiodub(a,b) trim(5149,68345)
-
Delete the frames referencing the original numbers first, then use trim referencing the new numbers
What do you mean by a frame accurate source filter? (I get my frame numbers from the .showframenumber command.)
Similar Threads
-
any one got guide on how to install avisynth that don' point to avisynth.nl
By MrKool in forum Newbie / General discussionsReplies: 7Last Post: 9th Aug 2023, 10:57 -
Avisynth .vs Avisynth+ 32-bit
By Santuzzu in forum Newbie / General discussionsReplies: 5Last Post: 21st Apr 2023, 15:52 -
Avisynth and Avisynth+ with MeGUI
By pooksahib in forum Video ConversionReplies: 8Last Post: 3rd Mar 2023, 05:30 -
moving from avisynth to avisynth+
By pooksahib in forum Video ConversionReplies: 9Last Post: 23rd Feb 2023, 08:37 -
How to use AviSynth
By ningnong132 in forum Newbie / General discussionsReplies: 5Last Post: 3rd Feb 2021, 19:47