手元に映像ファイルがなくても単色や、カラーバーを作ることが出来る。
公式wiki:FancyFilteringExamples – FFmpeg
基本コマンド
ffmpeg -f lavfi -i color -vframes 1 color.png
ffmpeg -f lavfi -i color=s=1280x720:r=30:d=10 output.mp4
ffplay -f lavfi -i color=c=black:s=340x240:r=25:sar=1/1:d=60
より正確なテストソース。
ffmpeg -f lavfi -i sws_flags=+accurate_rnd+bitexact;color -sws_flags accurate_rnd+bitexact -flags +bitexact -fflags +bitexact -vframes 1 color.png
ffplay -f lavfi -i sws_flags=+accurate_rnd+bitexact;color=c=black:s=340x240:r=25:sar=1/1:d=60 -sws_flags +accurate_rnd+bitexact -flags +bitexact -fflags +bitexact
音声のテストソースも同時に扱う。
ffmpeg -f lavfi -i smptehdbars=1920x1080:d=10 -f lavfi -i sine=frequency=1000:d=10 output.mp4
ffplay -f lavfi -i smptehdbars=1920x1080[out0];sine=frequency=1000[out1]"
テストシグナルの音声を作る sine
ピクセルフォーマットやビット深度の変更は入力ソースで変更する。
ffmpeg -f lavfi -i yuvtestsrc=d=5,format=yuv422p10le -c:v prores_ks -profile:v 4444xq -pix_fmt yuv422p10le yuvtestsrc.mov
ピクセルフォーマット一覧。
ffmpeg -pix_fmts
各種ソースは-filter_complex
内で作ることもできる。d=3で3秒のファイルにshortest=1ですべての出力を時間指定した3秒で止めるようにしている。
ffmpeg -f lavfi -i testsrc2=d=3 -filter_complex "mptestsrc,scale=320x240[1];sierpinski=320x240,[0][1]vstack=3:shortest=1" output
Continue reading “ffmpeg で使える映像のテストソース”