2014-04-09 137 views
-1

我有很多視頻,所以我想自動分割它們。他們將分爲兩個部分:如何使用ffmpeg快速分割批量視頻?

  • 第1部分:15分鐘
  • 2部分:其餘

搜索了很多,但沒有找到。請幫忙。

+0

你的問題對於[so]而言是offtopic。它似乎不是關於[幫助中心](http://stackoverflow.com/help/on-topic)中定義的範圍內的編程。您的問題可以被投票/標記爲遷移到[su]。 – LordNeckbeard

回答

1

使用-ss-t選項:

ffmpeg -i input -t 00:15:00 -codec copy output 
ffmpeg -ss 00:15:00 -i input -codec copy output 

FFmpeg documentation

-ss position (input/output) 
     When used as an input option (before "-i"), seeks in this input 
     file to position. Note the in most formats it is not possible to 
     seek exactly, so ffmpeg will seek to the closest seek point before 
     position. When transcoding and -accurate_seek is enabled (the 
     default), this extra segment between the seek point and position 
     will be decoded and discarded. When doing stream copy or when 
     -noaccurate_seek is used, it will be preserved. 

     When used as an output option (before an output filename), decodes 
     but discards input until the timestamps reach position. 

     position may be either in seconds or in "hh:mm:ss[.xxx]" form. 

    -t duration (output) 
     Stop writing the output after its duration reaches duration. 
     duration may be a number in seconds, or in "hh:mm:ss[.xxx]" form. 

     -to and -t are mutually exclusive and -t has priority. 

的例子使用-codec copy使用stream copy模式,而不是再編碼的。

+0

謝謝!你能告訴我如何使用ffmpeg分割批處理嗎? – user3513568

+0

@ user3513568你沒有提供足夠的信息給你一個更詳細的答案。你的操作系統是什麼?你想重新編碼輸出,還是你想流複製?如果您想重新編碼,您希望輸出的視頻,音頻和容器格式是什麼?所有的輸入都在一個目錄中嗎? – LordNeckbeard

+0

嗨,我使用Windows操作系統。所有在一個目錄中的輸入,我想使用流複製,因爲它是如此之快。謝謝 ! – user3513568