フィルタのfifo
と、マルチプレクサのfifo
の使い方。fifo
は複数のストリームの同時出力で処理速度の差が出る、例えばネットワーク障害や書き込み速度の差が付くときなどにつける。複数出力ではなく1出力で再接続するような使い方でも使える。フィルタのfifo
にはオプション設定はない。
fifo, afifo
フィルタが2024年2月8日以降のffmpeg 7.0から廃止になった。
利用例:
ffmpeg で複数出力
1つの出力内容を複数に振り分ける tee
基本コマンド
テストソースでエラーが出たときに再接続する例。
ffmpeg -f lavfi -re -i testsrc -c:v libx264 -map 0:v -flags +global_header -f fifo -fifo_format flv -max_recovery_attempts 20 -recovery_wait_time 5 -attempt_recovery 1 -recover_any_error 1 rtmp://example.com/livekey
avformat/fifo: avoid repeated scaling of timestamps on failure and re… · FFmpeg/FFmpeg@d9f07a5
Reconnect RTMP stream after disconnect and continue from specific position : ffmpeg
フィルタのfifo
の例。最初は普通再生で次に逆再生をつなげる。試すなら動画時間の短いファイルを使う。
ffmpeg -i input -filter_complex "[0:v]reverse,fifo[r];[0:a]areverse,afifo[ar];[0:v][0:a][r][ar]concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output
映像と音声を逆再生にエンコードする
Continue reading “複数の出力先のときの挙動を調整する fifo”