GNOME Bugzilla – Bug 759863
rtmpsink fails to authorize with rtmp server
Last modified: 2018-01-18 17:50:11 UTC
I can use ffmpeg to broadcast to following rtmp url but gstreamer rtmpsink always fails to broadcast with following rtmp url. rtmp://USERIDHIDDEN:PASSWORDHIDDEN@mtvnyc.dyndns.tv/AAAAAA/BBBBB/CCCCCC however, rtmpsink always works if I go to another server use a diferent url without user id and password. This causes rtmpsink to be unusable with any rtmp server which needs user id and password for authentication.
Try with > "rtmp://USERIDHIDDEN:PASSWORDHIDDEN@mtvnyc.dyndns.tv/AAAAAA/BBBBB/CCCCCC live=1" Note the space before live. There seem to be some bugs in librtmp that require such things.
If this still doesn't work, please provide a debug log with everything from rtmpsrc and librtmp.
(In reply to Sebastian Dröge (slomo) from comment #1) > Try with > > "rtmp://USERIDHIDDEN:PASSWORDHIDDEN@mtvnyc.dyndns.tv/AAAAAA/BBBBB/CCCCCC live=1" > > Note the space before live. There seem to be some bugs in librtmp that > require such things. I already tried it before reporting bug here :) . This does not work. How do i enable all logging specifically only for librtmp and rtmpsink ?
Created attachment 317897 [details] logs from only librtmp and rtmpsink (In reply to Sebastian Dröge (slomo) from comment #2) > If this still doesn't work, please provide a debug log with everything from > rtmpsrc and librtmp. I used GST_DEBUG=*rtmp*:9 to enable all logs only for both rtmpsink and librtmp.
Created attachment 317898 [details] logs from only librtmp and rtmpsink (In reply to Sebastian Dröge (slomo) from comment #2) > If this still doesn't work, please provide a debug log with everything from > rtmpsrc and librtmp. I used GST_DEBUG=*rtmp*:9 to enable all logs only for both rtmpsink and librtmp. I hidded password/userid
This doesn't look like a GStreamer problem? rtmp :0:: RTMP_Connect0, failed to connect socket. 110 (Connection timed out)
(In reply to Tim-Philipp Müller from comment #6) > This doesn't look like a GStreamer problem? > > rtmp :0:: RTMP_Connect0, failed to connect socket. 110 (Connection timed out) If you look into ffmpeg code then you will see that it is doing authorization for user id/password . You can pass same url to ffmpeg. ffmpeg has this code in https://www.ffmpeg.org/doxygen/2.5/rtmpproto_8c.html#a9a7e091fd7ebaac40c3f908a229d03c7 Isn't that gstreamer should also do in same way ?
librtmp does not have this API, you're looking at ffmpeg's internal RTMP implementation there. It seems like librtmp is no longer properly maintained and ffmpeg's internal RTMP support got lots of changes for problems like this. Someone would have to either pick up librtmp development, or someone will have to write a new RTMP plugin around some other library.
(In reply to Sebastian Dröge (slomo) from comment #8) > librtmp does not have this API, you're looking at ffmpeg's internal RTMP > implementation there. > > It seems like librtmp is no longer properly maintained and ffmpeg's internal > RTMP support got lots of changes for problems like this. Someone would have > to either pick up librtmp development, or someone will have to write a new > RTMP plugin around some other library. I think that gstreamer needs to write some plugin which can handle authentication. Otherwise, it is embarrassing to see some authentication is working in ffmpeg smoothly but gstreamer does not support it (although gstreamer has more nice audio-video sync feature than ffmpeg). Any idea when we can get more enhancement in gstrtmpsink ready for handling this authentication ?
When you implement it, or someone else who needs it enough to spend time on implementing it. There's also http://cgit.freedesktop.org/~ds/gst-rtmp/ which could be used as a base for a better implementation. Or someone could extract a better librtmp library from the code in ffmpeg.
(In reply to Sebastian Dröge (slomo) from comment #10) > When you implement it, or someone else who needs it enough to spend time on > implementing it. > > There's also http://cgit.freedesktop.org/~ds/gst-rtmp/ which could be used > as a base for a better implementation. Does this new gstrtmp2sink.c has authentication support for user id / password ? Could you please point me to code / function call where authentication needs to be done. It will be faster if you help me to understand/implement this authentication. I also want to know what other features you have in new gstrtmp2sink.c ? Thanks you so much.
I don't know the code myself, but to get that code in a useable state you have to understand all of it anyway. There's more work needed to get that releasable.
(In reply to Sebastian Dröge (slomo) from comment #12) > I don't know the code myself, but to get that code in a useable state you > have to understand all of it anyway. There's more work needed to get that > releasable. hmm . what about existing gstrtmpsink.c ? . You told me that this code has better implementation than existing code (see #comment 10). Can you please explain why you think that it has better implementation ?
It's having better network code, the one in librtmp is rather suboptimal. The new code is missing a lot of cleanup and features so far though, but it would be more future-proof
Tapas, Please find a patch attached to this ticket: https://bugzilla.gnome.org/show_bug.cgi?id=787102 It may also solve this issue.
*** This bug has been marked as a duplicate of bug 787102 ***