我试图只加快视频中的某些帧,而不将其分割成几个文件,下面是我用来这样做的代码
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但是我得到了一个“视频帧不匹配”错误
如能提供任何帮助,将不胜感激。
发布于 2015-05-28 11:06:42
框架实际上不匹配,因为通过AssumeFPS( 14 ),您正在将FPS的b改为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
https://stackoverflow.com/questions/30502319
复制相似问题