I did BlankClip(25) yet it only shows 24/25 frames in the bar and a duration of 960 ms @ 25 fps file. I thought writing BlankClip(25 etc) would lead to a 1 second blank clip. Am I missing something? AviSynth framecount madly impeding my workflow. Seems it's always off by 1 digit??
+ Reply to Thread
Results 1 to 21 of 21
-
-
Also when I do BlankClip..
It shows 24/25 = 960 ms but if I add that to any other clip - it rounds it off to 1 second which WOULD be BlankClip(26)...so confused whats going on with these numbers... -
Okay.
So I noticed if BlankClip is by itself the duration ends up being 1 minus the number stated in the function (if its 25 in a 25 fps file..it ends up being 24 out of 25 fps aka 960ms). If it is ADDED to any clip (AFTER - never first)...then the number (e.g. 25) ends up being 25...and 1 second long.
Anyone care to explain technicals of this? Read the documentation didn't see mention of this weird behavior... -
The first frame, using AviSynth counting, is numbered as '0'.
In addition, the default framerate is 24fps, so:
BlankClip(25)
creates a black-frame video at 24fps and 1.04 seconds in length. If, on the other hand, you put this in your script:
BlankClip(fps=25,length=25)
That creates a black-frame video at 25fps and exactly one second long. So, I don't know where or how you're getting your information. The included screenshot is from the second script I provided. You can get the same after opening the script in VDub and going File->File Information. -
Yes, frame numbers start at zero, not one. So the first frame of a clip is frame number 0. The last frame of a 25 frame clip is frame number 24.
-
BlankClip(fps=25,length=25)
That creates a black-frame video at 25fps and exactly one second long
-
You're looking at the start of the last frame (frame number 24, because numbering starts at "zero"), not the end of the last frame - If the playhead is showing the last frame. But that last frame has a 1/25 second duration , so the entire clip is indeed 1 second.
-
-
It's just a matter of perspective, not necessarily right or wrong
Vdub allows you to navigate to the "end" of the last frame, but it will be blank because you're looking at a frame that doesn't exist. Technically there is no frame there. The playhead in vdub (and most programs by convention) denotes the start time of a frame. -
Thank you!
I will DEFINITELY keep this in mind. I never thought of it in that way at all but it makes so much more sense. I feel silly but never got so precise with framecounts for it to matter to me much. Now I'm doing audio/video syncing and I'm trying to be accurate to the millisecond so now it's imperative
-
Ok.
So now I did Trim(0,25) on a clip...and ended up getting Total framecount: 26...
But when I do BlankClip(25) I get a total framecount of 25...any idea why ? I can tell in Trim 0 is frame # 1 and 25 is frame 26....but that really makes no sense to me -
-
Wow. Might I ask how you learned this?
Also for Trim - if it encludes everything to the end of frame 25 - then it's technically considered Frame 26's start at the end no?
So if for example we did Trim(0,24) then it would say the total frame count is 25? Because it starts from 0 and ENDS at Frame 24 aka Start of Frame 25?
Very confusing why they did Trim this way...why not just Trim(0,25) = start of frame 0 to start of frame 25? -
You could just read the manual.
http://avisynth.nl/index.php/Trim
starting at first_frame and running up to and including last_frame -
Wow. Might I ask how you learned this?
-
Ok people. I did read the documentation - but it still confuses me. Why Trim and BlankClip work differently. Doesn't answer my later question.
-
They don't really, except for the nomenclature necessitated by the functions they perform. With Trim you name the first and last frame (Trim(0,24)=25 frames=frames 0 through 24) and with BlankClip you give the total number of frames (BlankClip(25)=25 frames=frames 0 through 24). I don't think you really want a 25-frame blank clip to be named as BlankClip(24). And a 25 frame Trim cannot be named as Trim (0,25) as that will open up a whole new can of worms, so I don't know how you would rewrite it to be any better. Better minds than yours or mine have developed AviSynth. If it seems unintuitive to you, then it's something to learn as when using AviSynth you'll run across this kind of thing all the time. Again, though, most of what you consider a problem derives from the first frame being numbered as 'zero'. Once you have that straight much of the rest falls into place and this will never bother you again and you can spend your time wrestling with more important difficulties, like getting complex filters to run.
-
Thank you all wholly. Thank you manono for the interesting explanation. I have to say I will take it to heart and try my best to do as you mention.
-
And see "fencepost error": https://en.wikipedia.org/wiki/Off-by-one_error
Similar Threads
-
How to add blankclip onto end of video?
By VideoFanatic in forum RestorationReplies: 4Last Post: 22nd Jan 2016, 13:12 -
avisynth - How to write avisynth script for rgba overlay
By moelover in forum EditingReplies: 3Last Post: 13th Apr 2014, 12:24 -
4:3 to 16:9 avisynth
By sam1776 in forum Newbie / General discussionsReplies: 6Last Post: 11th Apr 2014, 07:05 -
How to retrieve the framecount of a video via commandline
By agni451 in forum EditingReplies: 4Last Post: 15th Jul 2012, 06:33 -
get framecount for video
By agni451 in forum EditingReplies: 0Last Post: 6th Jul 2012, 05:05