0

(ngnix configure file) OBS send to transcode->

application transcoder
{ exec ffmpeg -y -i rtmp://localhost/transcoder -b:v 6000k -minrate 5500k -maxrate 6500k -bufsize 7000k -vcodec libx264 -preset medium -s 1920x1080 -sws_flags bicubic -r 60 -x264-params hal-hrd=cbr:force-cfr=1:keyint=120 -pass 1 -an -f flv /dev/null;

exec ffmpeg -i rtmp://localhost/transcoder -b:v 6000k -minrate 5500k -maxrate 6500k -bufsize 7000k -vcodec libx264 -preset medium -s 1920x1080 -sws_flags bicubic -r 60 -x264-params hal-hrd=cbr:force-cfr=1:keyint=120 -pass 2 -acodec aac -ab 160k -strict -2 -f flv rtmp://localhost/transcoded-1080/; }

application transcoded-1080 { push rtmp://...

}

How to write to get 2-pass streaming ???

1 Answers1

2

You can't. 2 pass works by encoding the stream once for "practice" and using that information to establish a bitrate budget when doing the second pass for real. For pass 1 to complete, it needs the entire stream beginning to end. 2 pass for live video is an oxymoron.

The one exception is nvenc. nvenc has a rate control mode nvidia calls "2 pass", but its not the same two pass as x264.

szatmary
  • 3,903