0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【令和最新版】FFmpegからYouTubeLiveに映像を送信する

Posted at

FFmpegからYouTubeLiveに映像を送信する

※ 令和最新版(令和7年2月20日 時点)

結論

オーディオトラックが無いとダメらしい

ffmpegコマンド例

ffmpeg -y -f rawvideo -pix_fmt bgr24 -s 1280x720 -r 8 -i - -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -map 0:v -map 1:a -c:v libx264 -preset 5 -pix_fmt yuv420p -g 16 -tune zerolatency -bf 2 -b:v 2000k -maxrate 2000k -bufsize 4000k -c:a aac -b:a 128k -ar 44100 -f flv rtmp://a.rtmp.youtube.com/live2/your-youtube-stream-key

特に送信部分

-f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -map 0:v -map 1:a -c:v libx264 -preset 5 -pix_fmt yuv420p -g 16 -tune zerolatency -bf 2 -b:v 2000k -maxrate 2000k -bufsize 4000k -c:a aac -b:a 128k -ar 44100 -f flv rtmp://a.rtmp.youtube.com/live2/your-youtube-stream-key

オーディオトラック関係

-i anullsrc=channel_layout=stereo:sample_rate=44100 -map 0:v -map 1:a

-c:a aac -b:a 128k -ar 44100

使用例

FFmpegだけを使ってPCの画面を無音で配信するコマンド(Windows)

ffmpeg -f gdigrab -framerate 30 -i desktop -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -map 0:v -map 1:a -c:v libx264 -preset 5 -pix_fmt yuv420p -g 16 -tune zerolatency -bf 2 -b:v 2000k -maxrate 2000k -bufsize 4000k -c:a aac -b:a 128k -ar 44100 -f flv rtmp://a.rtmp.youtube.com/live2/your-youtube-stream-key
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?