2014-10-03 41 views
0

我對ffmpeg非常陌生,試圖將一系列圖片轉換爲視頻。第一張圖片沒有使用ffmpeg將圖片顯示到視頻

我使用的命令(複製/從一個教程修改)

ffmpeg -framerate 1/5 -start_number 1 -i dog%01d.jpg -c:v libx264 -r 30 -pix_fmt rgb24 dog.mp4 

基本上,我有標記dog1.jpg,dog2.jpg,dog3.jpg和dog4.jpg 4倍的圖像。

問題是我得到的輸出視頻的圖像從「dog2.jpg」開始,到「dog4.jpg」結束,這意味着它缺少序列中的第一個圖像(即dog1.jpg)。

我嘗試了不同的圖像組合,並且發生了相同的行爲,結果視頻從未獲得序列中的第一個圖像。

任何想法?

+1

無關,但爲什麼'-pix_fmt rgb24'?我預計會看到'-pix_fmt yuv420p',所以大多數非FFmpeg的播放器都可以對它進行解碼。試圖強制rgb24可能會導致使用yuv444p的輸出。如果你真的想要RGB輸出,你可以使用'libx264rgb'編碼器。 – LordNeckbeard 2014-10-03 15:37:40

回答

1

更改狗%01d.jpg狗%d.jpg

%01D意味着序列號與一個前導零

For example the pattern "img-%03d.bmp" will match a sequence of filenames 
of the form img-001.bmp, img-002.bmp, ..., img-010.bmp, etc. 

我想這也可能是有益的。

start_number 
Set the index of the file matched by the image file pattern to start to read from. 
Default value is 0. 

start_number_range 
Set the index interval range to check when looking for the first image file in the sequence, 
starting from start_number. Default value is 5. 

你可以在找到更多的信息。

相關問題