I have 2 videos, with different framerates and different length.
Video 1 is approximately 12 seconds long, 30 fps
Video 1 is approximately 7 seconds long, 29.97 fps
I say approximately because that's the approximate length I get from video player, real length could be something like 12.2 seconds.
I need to trim the longer video to match EXACTLY the shorter video.
I need AviSynth to do this, using the exact clip properties.
I know about FrameCount , FrameRate ,FrameRateNumerator , FrameRateDenominator - I just don't know how to use them to match the lengths.
Thank you.
PS: funny enough, AviSynth can open and StackVertical 2 videos with different framerates, no complaints there!!!
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
Yes, stacking in AviSynth works frame-by-frame, regardless of the frame rates.
You can't match the short clips exactly by time*. But the clips are so short it doesn't matter. Just apply AssumeFPS(30000, 1001) to the 30 fps clip and match frame by frame.
* Say your 29.97 fps clip is 210 frames long. It has an exact duration of 7.007 seconds (210 * 1001 / 30000). A 30 fps clip cannot have that length. It will have to be 210 frames long, exactly 7.0000 seconds (210 * 1000 / 30000) or 211 frames, 7.0333 seconds (211 * 1000 / 30000).Last edited by jagabo; 25th Jan 2024 at 12:11.
-
This example was using Stack and similar framerates.
But I may need this for other scripts, longer videos / much different framerates (25 & 30, for example).
I was testing something using: v001.framecount/v001.framerate
OR ConvertFPS - convert all to same framerate (usually the lowest one), then Trim using the above formula for length in seconds OR using same number of frames (since they all have same framerate)
But then I got sidetracked by a new project, I'll get back to that one as soon as possible. -
ConvertFPS() will produce blended frames. That will look very bad with a change from 29.97 to 30.00 fps (or vice versa). ChangeFPS() will duplicate or decimate frames to mach durations. AssumeFPS() just assumes the specified frame rate. It neither adds nor removes frames, just changes the duration of each frame (and hence the overall running time).
Note that I added some information to post #2. -
Yes, I know about all the FPS commands.
I have used ConvertFPS and it's OK, the video was very slow, doesn't look bad.
7.007 vs 7.000 is perfectly fine.
Thank you for your replies.
Similar Threads
-
File size 3x bigger when using Avisynth trim function through VDub2
By VideoYak in forum Newbie / General discussionsReplies: 6Last Post: 9th Sep 2023, 06:58 -
How to have multiple videos at different framerates inset within 1 frame
By archiveresearch in forum EditingReplies: 3Last Post: 16th May 2023, 23:16 -
Is there a way to trim many videos all at once?
By locutus85 in forum Newbie / General discussionsReplies: 5Last Post: 22nd May 2021, 18:42 -
avisynth: how to trim alwais the last 3 seconds of the source?
By marcorocchini in forum Newbie / General discussionsReplies: 4Last Post: 16th Jun 2020, 17:44 -
AviSynth audio trim
By aradmey in forum EditingReplies: 29Last Post: 25th Jun 2019, 20:36