rtmps via rtmp plugin broken on Ubuntu 20.04
It appears that rtmps support is broken on builds of gstreamer on Ubuntu 20.04. The newer rtmp2 plugin appears to be unaffected.
I've run various tests against various packed, and manually compiled copies of gstreamer, an all have the same result, that rtmps support plugin through the rtmp plugin is broken on Ubuntu 20.04.
Steps to reproduce:
- Spin up a box with a standard Ubuntu 20.04 install (on Digital Ocean for example)
- Update all packages and sources
- Either, install gstreamer 1.16.2 from the package manager, or compile gstreamer 1.17.1 from master (great instructions by the way!)
- Try streaming to an rtmps endpoint (I've reproduced with both Facebook live and Mux)
- Observe a handshake failure as below:
0:00:01.731792967 33895 0x560605c27aa0 ERROR rtmp :0:: RTMP_Connect1, handshake failed. 0:00:01.731834780 33895 0x560605c27aa0 WARN rtmpsink gstrtmpsink.c:293:gst_rtmp_sink_render:<rtmpsink0> error: Could not connect to RTMP stream "rtmps://global-live.mux.com:443/app/REDACTED live=1" for writing 0:00:01.731886954 33895 0x560605c27aa0 INFO GST_ERROR_SYSTEM gstelement.c:2140:gst_element_message_full_with_details:<rtmpsink0> posting message: Could not open resource for writing. 0:00:01.731943628 33895 0x560605c27aa0 INFO GST_ERROR_SYSTEM gstelement.c:2167:gst_element_message_full_with_details:<rtmpsink0> posted error message: Could not open resource for writing. 0:00:01.731992959 33895 0x560605c27aa0 INFO task gsttask.c:312:gst_task_func:<muxer:src> Task going to paused ERROR: from element /GstPipeline:pipeline0/GstRTMPSink:rtmpsink0: Could not open resource for writing. Additional debug info: gstrtmpsink.c(293): gst_rtmp_sink_render (): /GstPipeline:pipeline0/GstRTMPSink:rtmpsink0: Could not connect to RTMP stream "rtmps://global-live.mux.com:443/app/REDACTED live=1" for writing
Further levels of debug logging do not appear to yield anything relevant.
This does not appear to affect the rtmp2 plugin (built from master).
I've dug in further, and here's my matrix of where rtmps support is broken - the common factor is ubutntu 20.04 unfortunately:
|plugin||gstreamer version||ubuntu version||protocol||works?|
|rtmp||1.17.1 (master)||18.04 LTS||rtmp|
|rtmp||1.17.1 (master)||18.04 LTS||rtmps|
|rtmp||1.17.1 (master)||20.04 LTS||rtmp|
|rtmp||1.17.1 (master)||20.04 LTS||rtmps|
|rtmp2||1.17.1 (master)||20.04 LTS||rtmp|
|rtmp2||1.17.1 (master)||20.04 LTS||rtmps|
My working assumption is that something has changed in the underlying TLS libraries between 18.04 LTS and 20.04 LTS, which has caused this failure, since librtmp, which rtmp relies on hasn't been changed.
An obvious answer here is to just use rtmp2, but unfortunately rtmp2 isn't in the packaged gstreamer releases in apt for ubuntu. Will it be with the 17 release?
If you need an RTMPS endpoint and streamkey to test against, I can send one over privately.