使用来自终端的 VLC 通过 RTMP 广播到 YouTube Live

Broadcasting to YouTube Live via RTMP using VLC from terminal

当运行:

cvlc -vvv 'Bootstrap Tutorial.mp4' --sout '#rtp{dst=rtmp://a.rtmp.youtube.com/live2,name=pa1p-8c4m-zzvp-5j6t,mux=ts}'

我得到 this debugging log.

另外指定访问方式时:

cvlc -vvv 'Bootstrap Tutorial.mp4' --sout '#std{access=rtmp,dst=rtmp://a.rtmp.youtube.com/live2/pa1p-8c4m-zzvp-5j6t,mux=ts}'

我得到 this debugging log.

如何从终端使用 VLC 将实时视频和音频流式传输到 YouTube?

我调查过的资源:

  1. https://blog.vucica.net/2015/08/streaming-to-youtube-live-with-vlc-and-ffmpeg.html
  2. https://forum.videolan.org/viewtopic.php?f=14&t=130520&p=436913&hilit=rtmp+youtube#p436913
  3. https://forum.videolan.org/viewtopic.php?f=4&t=112221&p=380232&hilit=rtmp+youtube#p380232
VLC "${PATHTOFILE}" --sout '#transcode{vcodec=FLV1,acodec=mp3,samplerate=44100}:std{access=rtmp,mux=ffmpeg{mux=flv},dst=rtmp://a.rtmp.youtube.com/live2/'${STREAMID}

Streaming to YouTube Live with VLC and FFMPEG

我使用 vlc 从终端将视频实时传输到 youtube。

命令如下:

cvlc  -vvv FILE016.MP4 --sout '#transcode{vcodec=h264,scale=Auto,width=1280,height=720,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=rtmp,mux=ffmpeg{mux=flv},dst=rtmp://a.rtmp.youtube.com/live2/stream-name}'

请注意,当我尝试在低速互联网连接上将视频转码为 flv 时,youtube 有时会显示一条消息,要求使用 h264 作为转码器并将 ab 转码为 128。