2015-05-28 72 views
1

我試圖加快只在視頻的特定幀,不拆分爲幾個文件,這裏是我用來做這個AviSynth的 - 視頻幀率不匹配

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 

,但我的代碼得到一個「視頻幀速率不匹配」的錯誤

任何幫助,將不勝感激

回答

2

幀率實際不符,因爲AssumeFPS(14)你改變b鍵14的FPS,並嘗試連接兩個10 FPS片段。除非是VFR(可變幀頻),否則FPS通常不能沿着視頻方式改變,但這很複雜。

對於一個簡單的解決方案,你可以做到以下幾點:

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

+0

非常感謝,你能不能告訴我更多的鏈接或視頻,瞭解更多關於AviSynth的,例如我不能找到Audiorate()函數和ResampleAudio(任何文件) – Nassim

+1

@Nassim在Avisynth wiki本身有一篇關於Resample的文章(http://avisynth.nl/index.php/ResampleAudio),Audiorate是一個剪輯插件(http://avisynth.nl/index.php/Clip_properties )。至於資源,還有[Doom9](http://forum.doom9.org/forumdisplay.php?f=33)。我也推薦使用[AvsPmod](https://avspmod.github.io/)編輯器,它提供代碼完成。 – Seedmanc