rtmp2sink: not working with Steam RTMP server
For some reason Steam RTMP servers close the connection when trying to stream using rtmp2sink
. We do not have this problem when using the legacy rtmpsink
instead.
It would be good to understand what's going wrong. Ideally with help from someone at Valve if possible as we currently don't know why their servers do this.
@heftig @thaytan : I'm opening this so we have a place to track this issue we discussed.
$ GST_DEBUG="rtmp*sink:6" gst-launch-1.0 -v videotestsrc ! x264enc ! flvmux ! rtmp2sink location=rtmp://ingest-rtmp.broadcast.steamcontent.com/app/steam_xxxxxxxxxxxxxxxxx
Setting pipeline to PAUSED ...
0:00:00.020289751 741825 0x51cad0 INFO rtmp2sink gstrtmp2sink.c:529:gst_rtmp2_sink_start:<rtmp2sink0> Starting (async)
0:00:00.020427351 741825 0x435b60 DEBUG rtmp2sink gstrtmp2sink.c:969:gst_rtmp2_sink_task_func:<rtmp2sink0> gst_rtmp2_sink_task starting
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(string)Y444, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
Redistribute latency...
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(string)Y444, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = video/x-h264, codec_data=(buffer)01f4000dffe1001d67f4000d919b28283f602d41818190000003001000000303c8f142996001000668ebec448440, stream-format=(string)avc, alignment=(string)au, level=(string)1.3, profile=(string)high-4:4:4, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstFlvMux:flvmux0.GstFlvMuxPad:sink_0: caps = video/x-h264, codec_data=(buffer)01f4000dffe1001d67f4000d919b28283f602d41818190000003001000000303c8f142996001000668ebec448440, stream-format=(string)avc, alignment=(string)au, level=(string)1.3, profile=(string)high-4:4:4, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstFlvMux:flvmux0: streamable = true
0:00:00.047952689 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:920:gst_rtmp2_sink_set_caps:<rtmp2sink0> setcaps video/x-flv, streamheader=(buffer)< 464c5601010000000900000000, 120001240000000000000002000a6f6e4d65746144617461080000000a000c766964656f636f646563696400401c00000000000000057769647468004074000000000000000668656967687400406e000000000000000c417370656374526174696f58003ff0000000000000000c417370656374526174696f59003ff000000000000000096672616d657261746500403e000000000000000d766964656f64617461726174650040a0000000000000000f6d6574616461746163726561746f7202001a4753747265616d657220312e32322e3520464c56206d757865720007656e636f64657202001a4753747265616d657220312e32322e3520464c56206d75786572000c6372656174696f6e64617465020018576564204175672032332031343a31393a343520323032330000090000012f, 0900003300000000000000170000000001f4000dffe1001d67f4000d919b28283f602d41818190000003001000000303c8f142996001000668ebec4484400000003e >
0:00:00.047965664 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:939:gst_rtmp2_sink_set_caps:<rtmp2sink0> 'streamheader' field holds array
/GstPipeline:pipeline0/GstFlvMux:flvmux0.GstAggregatorPad:src: caps = video/x-flv, streamheader=(buffer)< 464c5601010000000900000000, 120001240000000000000002000a6f6e4d65746144617461080000000a000c766964656f636f646563696400401c00000000000000057769647468004074000000000000000668656967687400406e000000000000000c417370656374526174696f58003ff0000000000000000c417370656374526174696f59003ff000000000000000096672616d657261746500403e000000000000000d766964656f64617461726174650040a0000000000000000f6d6574616461746163726561746f7202001a4753747265616d657220312e32322e3520464c56206d757865720007656e636f64657202001a4753747265616d657220312e32322e3520464c56206d75786572000c6372656174696f6e64617465020018576564204175672032332031343a31393a343520323032330000090000012f, 0900003300000000000000170000000001f4000dffe1001d67f4000d919b28283f602d41818190000003001000000303c8f142996001000668ebec4484400000003e >
0:00:00.047974540 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:681:buffer_to_message:<rtmp2sink0> ignoring FLV header: buffer: 0x7fd1ec1417e0, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 13, offset none, offset_end none, flags 0x400
0:00:00.047980071 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:906:add_streamheader:<rtmp2sink0> Skipping streamheader buffer: 0x7fd1ec1417e0, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 13, offset none, offset_end none, flags 0x400
0:00:00.048006040 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:903:add_streamheader:<rtmp2sink0> Adding streamheader buffer: 0x7fd1ec1416c0, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 307, offset none, offset_end none, flags 0x400
0:00:00.048012673 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:903:add_streamheader:<rtmp2sink0> Adding streamheader buffer: 0x7fd1ec141a20, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 66, offset none, offset_end none, flags 0x2400
0:00:00.048018874 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:954:gst_rtmp2_sink_set_caps:<rtmp2sink0> Collected streamheaders: 3 buffers -> 2 messages
/GstPipeline:pipeline0/GstRtmp2Sink:rtmp2sink0.GstPad:sink: caps = video/x-flv, streamheader=(buffer)< 464c5601010000000900000000, 120001240000000000000002000a6f6e4d65746144617461080000000a000c766964656f636f646563696400401c00000000000000057769647468004074000000000000000668656967687400406e000000000000000c417370656374526174696f58003ff0000000000000000c417370656374526174696f59003ff000000000000000096672616d657261746500403e000000000000000d766964656f64617461726174650040a0000000000000000f6d6574616461746163726561746f7202001a4753747265616d657220312e32322e3520464c56206d757865720007656e636f64657202001a4753747265616d657220312e32322e3520464c56206d75786572000c6372656174696f6e64617465020018576564204175672032332031343a31393a343520323032330000090000012f, 0900003300000000000000170000000001f4000dffe1001d67f4000d919b28283f602d41818190000003001000000303c8f142996001000668ebec4484400000003e >
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
0:00:00.048168487 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:828:gst_rtmp2_sink_render:<rtmp2sink0> Skipping header buffer: 0x7fd1ec141480, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 13, offset none, offset_end none, flags 0x4400
0:00:00.048176433 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:828:gst_rtmp2_sink_render:<rtmp2sink0> Skipping header buffer: 0x7fd1ec1415a0, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 307, offset none, offset_end none, flags 0x4400
0:00:00.048189036 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:828:gst_rtmp2_sink_render:<rtmp2sink0> Skipping header buffer: 0x7fd1ec141900, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 66, offset none, offset_end none, flags 0x6400
0:00:00.048201790 741825 0x6ee060 LOG rtmp2sink gstrtmp2sink.c:832:gst_rtmp2_sink_render:<rtmp2sink0> render buffer: 0x7fd1ec1415a0, pts 99:99:99.999999999, dts 99:99:99.999999999, dur 99:99:99.999999999, size 7177, offset none, offset_end none, flags 0x4000
Redistribute latency...
0:00:00.048208814 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:854:gst_rtmp2_sink_render:<rtmp2sink0> Waiting for connection
New clock: GstSystemClock
0:00:11.725441905 741825 0x435b60 ERROR rtmp2sink gstrtmp2sink.c:1107:send_connect_error:<rtmp2sink0> Failed to connect: g-io-error-quark 0 'connect' cmd failed: Error receiving data: Connection reset by peer
0:00:11.725457384 741825 0x435b60 WARN rtmp2sink gstrtmp2sink.c:1117:send_connect_error:<rtmp2sink0> error: Failed to connect: 'connect' cmd failed: Error receiving data: Connection reset by peer
0:00:11.725463285 741825 0x435b60 WARN rtmp2sink gstrtmp2sink.c:1117:send_connect_error:<rtmp2sink0> error: domain g-io-error-quark, code 0
ERROR: from element /GstPipeline:pipeline0/GstRtmp2Sink:rtmp2sink0: Failed to connect: 'connect' cmd failed: Error receiving data: Connection reset by peer
Additional debug info:
../subprojects/gst-plugins-bad/gst/rtmp2/gstrtmp2sink.c(1117): send_connect_error (): /GstPipeline:pipeline0/GstRtmp2Sink:rtmp2sink0:
domain g-io-error-quark, code 0
0:00:11.725533228 741825 0x435b60 DEBUG rtmp2sink gstrtmp2sink.c:565:stop_task:<rtmp2sink0> Stopping loop
Execution ended after 0:00:11.677449270
Setting pipeline to NULL ...
0:00:11.725571220 741825 0x6ee060 DEBUG rtmp2sink gstrtmp2sink.c:619:gst_rtmp2_sink_event:<rtmp2sink0> Got EOS: stopping publish
0:00:11.725590276 741825 0x51cad0 DEBUG rtmp2sink gstrtmp2sink.c:636:gst_rtmp2_sink_unlock:<rtmp2sink0> unlock
0:00:11.725598201 741825 0x435b60 DEBUG rtmp2sink gstrtmp2sink.c:1000:gst_rtmp2_sink_task_func:<rtmp2sink0> iterating main context to clean up
0:00:11.725599182 741825 0x51cad0 DEBUG rtmp2sink gstrtmp2sink.c:651:gst_rtmp2_sink_unlock_stop:<rtmp2sink0> unlock_stop
0:00:11.725618168 741825 0x435b60 DEBUG rtmp2sink gstrtmp2sink.c:1010:gst_rtmp2_sink_task_func:<rtmp2sink0> gst_rtmp2_sink_task exiting
0:00:11.725674275 741825 0x51cad0 DEBUG rtmp2sink gstrtmp2sink.c:636:gst_rtmp2_sink_unlock:<rtmp2sink0> unlock
0:00:11.725680416 741825 0x51cad0 DEBUG rtmp2sink gstrtmp2sink.c:651:gst_rtmp2_sink_unlock_stop:<rtmp2sink0> unlock_stop
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
../subprojects/gstreamer/libs/gst/base/gstbasesrc.c(3132): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason error (-5)