AlekseiV
17th September 2010, 04:25
For example, a script to speed up a video by 5x:
SetMTMode(2,4)
LoadPlugin("C:\Program Files (x86)\megui\tools\ffms\ffms2.dll")
audio = FFAudioSource("some_video.mkv")
video = FFVideoSource("some_video.mkv")
comb = AudioDub(video, audio)
framerate = 23.976 # needs to match input
speedup = 5 # speedup factor
# do any editing here with combined clip
# speedup
video_fast = comb.AssumeFPS(speedup*framerate).ChangeFPS(framerate)
SetMTMode(3)
audio_fast = comb.TimeStretch(tempo = (speedup*framerate)/(framerate)*100.0, sequence=50, overlap=10)
return AudioDub(video_fast, audio_fast).ConvertToYV12()
Is there any way to get the FPS within the script, so it does not need to be manually defined?
Obviously this is not some huge effort to manually define the script, but it saves some time and may be easier for newbie. Is there a function for it?
SetMTMode(2,4)
LoadPlugin("C:\Program Files (x86)\megui\tools\ffms\ffms2.dll")
audio = FFAudioSource("some_video.mkv")
video = FFVideoSource("some_video.mkv")
comb = AudioDub(video, audio)
framerate = 23.976 # needs to match input
speedup = 5 # speedup factor
# do any editing here with combined clip
# speedup
video_fast = comb.AssumeFPS(speedup*framerate).ChangeFPS(framerate)
SetMTMode(3)
audio_fast = comb.TimeStretch(tempo = (speedup*framerate)/(framerate)*100.0, sequence=50, overlap=10)
return AudioDub(video_fast, audio_fast).ConvertToYV12()
Is there any way to get the FPS within the script, so it does not need to be manually defined?
Obviously this is not some huge effort to manually define the script, but it saves some time and may be easier for newbie. Is there a function for it?