[FFmpeg-user] Streaming to youtube-live / stream copying from surveillance cam to youtube-live not recognized

Steven Kan steven at kan.org
Thu Mar 17 21:25:32 EET 2022

> On Mar 17, 2022, at 12:16 PM, Christian Pickhardt <ch.pickhardt at t-online.de> wrote:
> Mail an ffmpeg-user at ffmpeg.org
> Hello ffmpeg-user-community,
> since some weeks I am trying to copy a stream from an rtsp-stream to a rtmp-stream (targeting youtube) without success.
> I have tested recent ffmpeg builds on Windows, and on my raspberry pi which is running ffmpeg version 4.4.
> What works:
> Version independed i can view the source stream by:
> ffplay -i rtsp://<user>:<password>@<camera-ip>/<url>
> It is also possible to write the stream to disk an view it using different viewers: VLC/Firefox/Windowsplayer and so on.
> I can easyly stream data from file(created with a GoPro-Camera) using rtmp to youtube-live. Almost instantly the stream is recognized
> and shows up after some seconds.
> What doesn't work:
> When I try to stream the data (stream or file) from my WebCams (D-Link or Trendnet) to youtube-live no stream is detected.
> --------------------------This works without problems---------------------------
> C:\Temp\..\ffmpeg-master-latest-win64-gpl\bin>ffmpeg -i "c:\Temp\GOPR1903.MP4" -r 25 -f flv rtmp://a.rtmp.youtube.com/live2/5zq1-uztf-kuz2-ab21-ccda (<-just a sample key...)
> --------------------------------------------------------------------------------
> ---------------------------The following seems to work, but w/o result,--------------------------------
> --------------------------meaning no data stream is detected on youtube-live:--------------------------
> (all ips and keys are randomly choosen...)
> C:\Temp\Software\MPlayer\ffmpeg-master-latest-win64-gpl\bin> ffmpeg -loglevel debug -i rtsp://<rtsp_usr>:ufwoierwe1321232 at -rtsp_transport  tcp -codec copy -bufsize 512k -g 50 -threads 2 -pix_fmt yuvj420p -f h264 "rtmp://a.rtmp.youtube.com/live2/5zq1-uztf-kuz2-ab21-ccda”

Try changing -f h264 to -f flv. YouTube Stream Now prefers flv for some reason. Here’s what I use from a Wyze Cam v3 with RTSP firmware:

./ffmpeg -thread_queue_size 2048 -i 'rtsp://anonymous:password@' -vcodec copy -acodec copy -t 2:00:00 -f flv "rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key"

and it works just fine:

https://www.youtube.com/channel/UCIVY11504PcY2sy2qpRhiMg/live <https://www.youtube.com/channel/UCIVY11504PcY2sy2qpRhiMg/live>

and from a Reolink RLC-423:

./ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i "rtsp://anonymous:password@" -f concat -safe 0 -i playlist.txt -vcodec copy -acodec copy -t 01:47:02 -f flv "rtmp://a.rtmp.youtube.com/live2/my-other-youtube-key”

The playlist is because the Reolink doesn’t have an audio track, which YouTube Stream Now requires.

More information about the ffmpeg-user mailing list