2017-04-21 106 views
2

我用FFMPEG連接了視頻。這裏是代碼: ffmpeg -i "concat:video1.webm|video2.webm|video3.webm|video4.webm" -c copy output_video.webmFFMPEG concat視頻已完成,但視頻丟失

連接完成後,我播放視頻,但視頻顯示只有video1。它錯過了video2,video3,video4。雖然,output_video.webm是全尺寸。我不知道爲什麼?請幫助我,如何解決它?

太感謝你了, 邊

回答

0

它不工作,因爲「CONCAT協議」(也稱爲二進制CONCAT)不支持「WEBM」文件格式。它支持avi,mpeg-ts。有關詳細信息,請參閱FFMPEG Concat文檔。

解決方案: 如以上文獻中所提到的,可以使用 '的concat分路器',這是如下更靈活的:

ffmpeg -f concat -i mylist.txt -c copy output 


Where mylist.txt is something like: 

# this is a comment 
file '/path/to/file1' 
file '/path/to/file2' 
file '/path/to/file3' 

組合2個MP4文件(video1.mp4和VIDEO2的實施例。 mp4)在當前目錄中。

ffmpeg的命令:

ffmpeg -f concat -i filelist.txt -c copy output.mp4 

內容 'Filelist.txt中'

file 'video1.mp4' 
file 'video2.mp4' 

串聯視頻的現有@ output.mp4

+0

感謝阿倫·庫馬爾,我使用記錄的視頻從網頁瀏覽器我使用這個命令來連接:cd/var/www/html/record/uploads/tmp; ls> filelist.txt;找到* .webm | sed's:\:\\\:g'| sed's/^/file /'> filelist.txt; ffmpeg -f concat -i filelist.txt -c copy /var/www/html/record/uploads/".$filename.".webm; rm -rf * –

+0

希望它解決了你的問題。 – arunk2

+0

當我完成concat視頻。我打開視頻,但無法顯示所有內容。輸出視頻只顯示file1中的一個。我曾嘗試在窗口合併MKVToolNix軟件的視頻。它有同樣的問題。 MKVToolNix合併視頻成功,但我打開視頻,它無法顯示所有內容。輸出視頻僅顯示file1的內容。我不知道爲什麼?以及如何解決它? –