VideoHelp Forum




+ Reply to Thread
Results 1 to 21 of 21
  1. 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??
    Quote Quote  
  2. 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...
    Quote Quote  
  3. 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...
    Quote Quote  
  4. 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.
    Image Attached Thumbnails Click image for larger version

Name:	FileInformation.jpg
Views:	278
Size:	39.8 KB
ID:	38561  

    Quote Quote  
  5. 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.
    Quote Quote  
  6. BlankClip(fps=25,length=25)

    That creates a black-frame video at 25fps and exactly one second long
    This creates a .960ms clip according to AvsP for me. But yes when I encode it is 1 second :/ weird. Bug with AvsP?

    Quote Quote  
  7. Originally Posted by TheLastOfThem View Post
    Bug with AvsP?
    Obviously.
    Quote Quote  
  8. 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.
    Quote Quote  
  9. Originally Posted by poisondeathray View Post
    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.
    Ah......so not a bug then....definitely confusing o_o....
    Quote Quote  
  10. Thank you PoisonDeath, Manono and Jagabo....this definitely helps a lottt
    Quote Quote  
  11. 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.
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    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
    Quote Quote  
  13. 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
    Quote Quote  
  14. Originally Posted by TheLastOfThem View Post
    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
    Because Trim() is inclusive. It includes everything from the start of frame zero, to the end of frame 25 = 26 frames total

    Blankclip(25) means 25 frames total. From frame zero to end of frame 24 = 25 frames total
    Quote Quote  
  15. 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?
    Quote Quote  
  16. Originally Posted by TheLastOfThem View Post
    Wow. Might I ask how you learned this?
    You could just read the manual.

    http://avisynth.nl/index.php/Trim

    starting at first_frame and running up to and including last_frame
    Quote Quote  
  17. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Wow. Might I ask how you learned this?
    By reading the goddämn documentation:
    Image Attached Thumbnails Click image for larger version

Name:	avisynth-documentation.png
Views:	699
Size:	106.6 KB
ID:	38567  

    Quote Quote  
  18. Ok people. I did read the documentation - but it still confuses me. Why Trim and BlankClip work differently. Doesn't answer my later question.
    Quote Quote  
  19. Originally Posted by TheLastOfThem View Post
    Why Trim and BlankClip work differently.
    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.
    Quote Quote  
  20. 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.
    Quote Quote  
  21. Originally Posted by manono View Post
    most of what you consider a problem derives from the first frame being numbered as 'zero'.
    And see "fencepost error": https://en.wikipedia.org/wiki/Off-by-one_error
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!