GNOME Bugzilla – Bug 761433
rtmpsink: streaming to youtube no longer works on git master
Last modified: 2016-09-15 11:23:56 UTC
This problem is maybe related to #738674 and/or #760242. Streaming to a live event on YouTube appears to be broken. The following pipeline does not work anymore but used to work a couple of months ago on git master: gst-launch-1.0 -evvv videotestsrc is-live=true do-timestamp=false ! capsfilter caps="video/x-raw, format=I420, width=854, height=480, framerate=(fraction)25/1" ! videoconvert ! queue ! videoconvert ! x264enc bitrate=2000 key-int-max=25 option-string="keyint=25:min-keyint=25:no-scenecut:bframes=1" bframes=1 tune=2 speed-preset=ultrafast ! h264parse ! queue ! mux. audiotestsrc is-live=true wave=0 ! capsfilter caps="audio/x-raw, endianness=(int)1234, format=F32LE, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2" ! queue ! avenc_aac bitrate=96000 compliance=-2 ! capsfilter caps="audio/mpeg,mpegversion=4,stream-format=raw" ! queue ! flvmux name=mux ! location="rtmp://a.rtmp.youtube.com/live2/<rtmp_id>" async=true sync=false When using ffmpeg for the rtmp part, things work without a problem: mkfifo pipe;gst-launch-1.0 -evvv videotestsrc is-live=true do-timestamp=false ! capsfilter caps="video/x-raw, format=I420, width=854, height=480, framerate=(fraction)25/1" ! videoconvert ! queue ! videoconvert ! x264enc bitrate=2000 key-int-max=25 option-string="keyint=25:min-keyint=25:no-scenecut:bframes=1" bframes=1 tune=2 speed-preset=ultrafast ! h264parse ! queue ! mux. audiotestsrc is-live=true wave=0 ! capsfilter caps="audio/x-raw, endianness=(int)1234, format=F32LE, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2" ! queue ! avenc_aac bitrate=96000 compliance=-2 ! capsfilter caps="audio/mpeg,mpegversion=4,stream-format=raw" ! queue ! flvmux name=mux ! filesink location=pipe async=true sync=false (and in another console): fmpeg -f flv -i pipe -y -vcodec copy -f flv rtmp://a.rtmp.youtube.com/live2/<rtmp_id> Adding an aacparse (as would normally be neccesary), seems to be causing even more trouble by locking up the pipeline: mkfifo pipe;gst-launch-1.0 -evvv videotestsrc is-live=true do-timestamp=false ! capsfilter caps="video/x-raw, format=I420, width=854, height=480, framerate=(fraction)25/1" ! videoconvert ! queue ! videoconvert ! x264enc bitrate=2000 key-int-max=25 option-string="keyint=25:min-keyint=25:no-scenecut:bframes=1" bframes=1 tune=2 speed-preset=ultrafast ! h264parse ! queue ! mux. audiotestsrc is-live=true wave=0 ! capsfilter caps="audio/x-raw, endianness=(int)1234, format=F32LE, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2" ! queue ! avenc_aac bitrate=96000 compliance=-2 ! aacparse ! capsfilter caps="audio/mpeg,mpegversion=4,stream-format=raw" ! queue ! flvmux name=mux ! filesink location=pipe async=true sync=false if need be, I can post logs but running the given pipelines should make the problem evident right away. I am aware of the troubles with regards to librtmp. This bug report could be for future reference and for people hitting this issue when trying the pipelines as given in [1]. [1] http://sourceforge.net/p/snowmix/wiki/Snowmix%20and%20CDNs/
Any chance you could try and git bisect to find the commit(s) that broke it?
Any pointers where I should start? Should I just start by bisecting changes on rtmpsink only? Or do you suspect that the problem is related to another element /something else?
Streaming live to youtube works for me. Here's the pipeline I use for testing: gst-launch-1.0 \ videotestsrc is-live=1 \ ! video/x-raw,width=320,height=240,framerate=30/1 \ ! timeoverlay \ ! x264enc bitrate=2000 ! video/x-h264,profile=main \ ! queue ! mux. \ audiotestsrc is-live=1 wave=12 ! faac ! queue ! mux. \ flvmux streamable=1 name=mux \ ! rtmpsink location="rtmp://a.rtmp.youtube.com/live2/x/<name> app=live2"
Funny, (almost) the exact same pipeline fails here most of the time with a fresh GIT master clone of today (Ubuntu 14.04 x64). I set-up my YouTube event to accept a 720p stream. gst-launch-1.0 videotestsrc is-live=1 ! video/x-raw,width=1280,height=720,framerate=30/1 ! timeoverlay ! x264enc bitrate=2000 ! video/x-h264,profile=main ! queue ! mux. audiotestsrc is-live=1 wave=12 ! faac ! queue ! mux. flvmux streamable=1 name=mux ! rtmpsink location="rtmp://a.rtmp.youtube.com/live2/x/<name> app=live2" GST_DEBUG=4 log: http://pastebin.com/fg8SpyE0 GST_DEBUG=5 log: https://s3-eu-west-1.amazonaws.com/gstreamer-public/test.log I can see that a bit of data is sent to YouTube, but then it abruptly stops after a second or two. The YouTube Control Center also shows that it receives a bit of data but reports a general "error" shortly after. Sometimes it works but most of the time it fails. I wasn't able to grab a log of a successful run.
As we both have git master on gstreamer side, what version of librtmp are you using ? I'm running 2.4 (rpm from rpmfusion, didn't check if it's patched or not).
(Note, test.log returns Access Denied, the first log contains no error or warning that could indicate a problem on GStreamer side. For the future, set GST_DEBUG_NO_COLOR=1 makes the logs more readable from a paste)
Forgot about the color trick! Will do that next time. I am using the distro-provided librtmp-dev package and according to http://packages.ubuntu.com/trusty/librtmp-dev that is version 2.4 as well.
Every-time I try the mentioned pipeline, it just work. You should maybe describe all the steps you are doing to reproduce ? So far, Google server have given me clear information when a stream was rejected. You should maybe describe the parameters you have configured ? Did you properly replace <name> with your stream secret name ? Were you properly connected to the https://www.youtube.com/live_dashboard when you started the steam ? For now, there is still no indication that a bug occured on GStreamer side. Remote end hangup for you, and that's pretty much all we know. Nothing we can use to help you fix this issue really. Stepping through steps to use Google Youtube live event is not something we usually do within this bugzilla.
(In reply to Arjen Veenhuizen from comment #4) > Funny, (almost) the exact same pipeline fails here most of the time with a > fresh GIT master clone of today (Ubuntu 14.04 x64). I set-up my YouTube > event to accept a 720p stream. > > gst-launch-1.0 videotestsrc is-live=1 ! > video/x-raw,width=1280,height=720,framerate=30/1 ! timeoverlay > ! x264enc bitrate=2000 ! video/x-h264,profile=main ! queue ! mux. > audiotestsrc is-live=1 wave=12 ! faac ! queue ! mux. flvmux streamable=1 > name=mux ! rtmpsink > location="rtmp://a.rtmp.youtube.com/live2/x/<name> app=live2" > This exact pipeline also works fine for me, albeit with lowered bitrate to cope with my DSL upload speed. git master of GStreamer librtmp Version : 2.4 Release : 5.20150925.gita107cef.fc23 on Fedora 23
In that case I think it has to do with my specific installation. Just tried it again with git master of today and it still fails. librtmp info: librtmp0:amd64 2.4+20121230 amd64 Os: Xubuntu 14.04 x64, fully patched, kernel 4.2
Any update ? If not I would suggest to close it until a dev can reproduce.
I can confirm that this seem to be working (again?) on my install (1.9.2). Just tested it. I guess we can safely put this to obsolete. For future reference, the first pipeline in my first post is missing an rtmpsink. Example pipeline to stream H264/AAC to YouTube using GStreamer 1.x: gst-launch-1.0 -evvv videotestsrc is-live=true do-timestamp=false ! capsfilter caps="video/x-raw, format=I420, width=1280, height=720, framerate=(fraction)25/1" ! videoconvert ! queue ! videoconvert ! x264enc bitrate=2000 key-int-max=25 option-string="keyint=25:min-keyint=25:no-scenecut:bframes=1" bframes=1 tune=2 speed-preset=ultrafast ! h264parse ! queue ! mux. audiotestsrc is-live=true wave=0 ! capsfilter caps="audio/x-raw, endianness=(int)1234, format=F32LE, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2" ! queue ! avenc_aac bitrate=96000 compliance=-2 ! capsfilter caps="audio/mpeg,mpegversion=4,stream-format=raw" ! queue ! flvmux name=mux ! rtmpsink location="rtmp://a.rtmp.youtube.com/live2/<rtmp_id>" async=true sync=false