I'm trying to extend the duration of certain shots by using Loop. It seems the more times I use Loop, the more it throws off the timing of my previous cuts. Something is happening, anyway. I've been going in circles for hours re-defining where I want the cuts to be, and they keep shifting. Am I not using Loop correctly?
Code:LoadPlugin("C:\DVD\DGDecode.dll") clip1 = MPEG2Source("C:\DVD\21\VTS_01_1.d2v") clip2 = MPEG2Source("C:\DVD\21 DC\VTS_01_1.d2v") clip2.Trim(0,5640)FadeOut(19) + clip1.Trim(2721,2887)Loop(34,2887,2887) + clip1.Trim(2898,2995) + clip2.Trim(5943,5986) + clip1.Trim(2998,3167)Loop(3,3167,3167) + clip1.Trim(3168,3266) + clip1.Trim(3268,4158) + clip1.Trim(4158,4589) + clip1.Trim(4592,5719)Loop(3,5719,5719) + clip1.Trim(5719
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
-
It could be as simple as needing to add all the "." (DOT) between command elements properly, but I would say create intermediate variables for each pre-loop segment, then create variables for those looped segments, then concatenate (command order is important here). That way you can see whether each command is executing properly. Also, you could do intermediate line-wise "Return" commands (with the remainders commented out) to visually cross-check each element.
Scott -
You know that the Loop command adds one less frame than you're saying, right? So Loop(34,2887,2887) adds 33 new copies of frame 2887 and the frame count increases by 33? Also, as Cornucopia says, make sure to put the dots between commands. The whole thing looks kind of convoluted to me, though. Rather than all those non-aligned splices with those commands I'd do it in a way it could be checked as I went along:
A=clip2.Trim(0,5640).FadeOut(19)
B=clip1.Trim(2721,2887).Loop(34,2887,2887)
C=clip1.Trim(2898,2995)
.
.
#Return B #to test out that each line does what you want
A+B+C+......
And Clip1 and Clip2 are the same, right? Anyway, I think I'm suggesting the same as Cornucopia - break it down so you can check for mistakes along the way -
Thanks, guys. Not having the dot before Loop is what was screwing me up.
Manono, your "column" method for the script is much more organized and I much prefer it. Thanks!
I did not know that, thank you. Is this page incorrect?
http://avisynth.nl/index.php/Loop
It makes it sound like Loop(34,2887,2887) would repeat frame 2887 thirty-four times. -
I don't know if it's wrong or not, but it's certainly unclear.
You can easily test yourself to confirm (or disprove) what I say. Just add a loop to a script and check how many frames are added - the number you're looping or that number minus 1. -
The frame is shown 34 times. It was originally shown 1 time. So you're adding 33 more. This syntax gives the ability to remove frames with Loop(0,...) which is explained in the the wiki. They could have been more clear by saying "displayed a total of X times" instead of "repeated X times".
Last edited by jagabo; 12th Oct 2015 at 18:19.
-
-
Anonymous344Guest
Call ShowFrameNumber() after you load your video, lomaidala.
Code:MPEG2Source() ShowFrameNumber(scroll=true)
Remember that the order in which you call Loop() and Trim() makes a difference.
Code:Version() ShowFrameNumber(scroll=true) Loop(3,100,100) Trim(0,200)
Code:Version() ShowFrameNumber(scroll=true) Trim(0,200) Loop(3,100,100)
because the former produces a 201-frame video, and the latter, a 204-frame one.
Moreover, if you ever need to call Loop() multiple times, work backwards. In other words, loop the frames that occur later in the video before the frames that occur earlier on.
Similar Threads
-
MKV container - Get frame count without extracting (CFR source)?
By Interpolator in forum Video ConversionReplies: 4Last Post: 16th Aug 2015, 22:00 -
Deinterlacer changing total frame count and overall length of the video
By killerteengohan in forum DVD RippingReplies: 16Last Post: 15th Jun 2014, 14:56 -
Avisynth : Encoding Issues (Out Of Memory and Frames Count)
By DayDreamer3d in forum EditingReplies: 8Last Post: 7th Nov 2013, 23:36 -
DVDStyler - please advise on menu frame count/hardware compatibility
By dogcatcher in forum Authoring (DVD)Replies: 9Last Post: 15th Dec 2011, 02:48 -
Frame count display in Media Player Classic? Or something else?
By Hoser Rob in forum Software PlayingReplies: 2Last Post: 10th Apr 2011, 10:59