View Full Version : Split video every 9mins
Ruriko
26th June 2009, 08:20
How do I split the video every 9 minutes?
J_Darnley
26th June 2009, 11:56
n=0
Trim( int( n*9*60*Framerate ), int( (n+1)*9*60*Framerate-1 ) )
Then just edit n for every time you want to make a split. I don't know what encoder you are using but it may have the ability to this. x264 has --seek and --frames options
Gavino
26th June 2009, 14:37
Trim( int( n*9*60*Framerate ), int( (n+1)*9*60*Framerate-1 ) )
Don't forget the boundary case!
Unless the video length is an exact multiple of 9 minutes, the last slice requires special treatment.
start = int( n*9*60*Framerate )
end = int( (n+1)*9*60*Framerate )-1
end = end >= Framecount ? 0 : end
Trim(start, end)
But actually, Avisynth is not the best tool for this job, since each segment requires a separate script and all segments end up being re-encoded. Better to use something like VirtualDub's "Save segmented AVI".
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.