1

I am trying to speed up only certain frames in a video, without splitting it into several files, here is the code that I used to do this

AVISource("C:\Users\me\Desktop\source_10FPS.avi")   # get the 10 fps video source

a= Trim(0,100)                                       # trim the first 10  seconds
b= Trim(100,200).AssumeFPS(14, sync_audio=TRUE)      # trim and speed it up 
c= Trim(200,0).AssumeFPS(10, 1, true)                #trim and go back to original speed 

return (a+b+c)                                       # combine the 3 Trims

but I get a "video framerate doesn't match" error

any help would be appreciated

4

1 回答 1

2

帧率实际上不匹配,因为通过 AssumeFPS(14) 您将 b 的 FPS 更改为 14 并尝试将其与两个 10 FPS 片段连接起来。FPS通常不会随着视频的变化而变化,除非是VFR(可变帧率),但这很复杂。

对于更简单的解决方案,您可以执行以下操作:

Ar=Audiorate()                                                                  #get audio sampling rate of original clip
a= Trim(0,100)                                                                  #trim the first 10  seconds
b= Trim(101,200).AssumeFPS(14, sync_audio=TRUE).ChangeFPS(10).ResampleAudio(Ar) #trim and speed it up while keeping audio rate and fps intact
c= Trim(201,0)                                                                  #note that to avoid having repeating frames (#100 and #200) you need to change Trim numbers

您也可以使用 ConvertFPS 而不是 ChangeFPS 来实现更流畅的播放。


在此处了解更多信息:http: //avisynth.nl/index.php/FPS

于 2015-05-28T11:06:42.113 回答