web-dev-qa-db-ja.com

端末からのビデオの最後に画像を追加する方法

Ubuntu 14.04を使用しています。端末からのビデオの最後に画像を追加するにはどうすればよいですか?たとえば、input.mp4というビデオがあり、FacebookおよびTwitterアカウントを示すinput.pngという画像をそのビデオの最後に追加し、その結果をoutput.mp4という新しいビデオに出力したいとします。コマンドラインからそれを行うにはどうすればよいですか?

 ________                          ________            ________
|        |                        |        |          |        |
| input  |  add image at the end  | input  |  avconv  | output |  
| mp4    |  ------------------->  | png    |  ----->  | mp4    | 
|________|                        |________|          |________|
1
asullaherc

Ffmpegでこれを行う最も簡単な方法は、PNGファイルだけでビデオを作成することです

ffmpeg -loop 1 -i input.png -c:v libx264 -t 30 -pix_fmt yuv420p picture.mp4

注:-t 30は、画像を秒単位で表示する時間です

次に、2つを1つのビデオに結合します

ffmpeg -i "concat:input.mp4|picture.mp4" -c copy output.mp4

お役に立てば幸いです!

幸運を :)

1
ThatGuy