GStreamer Mac(OSX) avfvideosrc to RTMP issue (Getting Stuck at Redistribute Latency)

51 Views Asked by At

I am trying to get gstreamer to stream video from avfvideosrc to RTMP. Its partially working.

Here is the command I am using

 gst-launch-1.0 -e avfvideosrc ! queue ! videoconvert ! x264enc ! flvmux streamable=true ! queue ! rtmpsink location='rtmp://<my-server>/my-stream/live'

The above command works but I am missing something

Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock Redistribute latency...

It gets stuck at this point and till now on the server I have no logs. No attempt to make any connection. Once I press Ctrl-C

^Chandling interrupt. Interrupt: Stopping pipeline ... EOS on shutdown enabled -- Forcing EOS on the pipeline Waiting for EOS... Redistribute latency... Got EOS from element "pipeline0". EOS received - stopping pipeline... Execution ended after 0:00:06.339788000 Setting pipeline to NULL ... Freeing pipeline ...

Interestingly once I press Ctrl-C it establishes connection starts streaming to the [MediaMTX server(https://github.com/bluenviron/mediamtx) and then processes EOF and closes down. The logs on the server at this point look like this

Feb 06 04:08:18 ip-<private_ip> mediamtx[3516550]: 2024/02/06 04:08:18 INF [RTMP] [conn <mac_ip>:29605] opened Feb 06 04:08:18 ip-<private_ip> mediamtx[3516550]: 2024/02/06 04:08:18 INF [RTMP] [conn <mac_ip>:29605] is publishing to path 'my-stream/live', 1 track (H264) Feb 06 04:08:19 ip-<private_ip> mediamtx[3516550]: 2024/02/06 04:08:19 INF [RTMP] [conn <mac_ip>:29605] closed: EOF

It is clearly establishing the connection once I press Ctrl-C and tearing down because of EOF. I have tried executing the same command to publish to Youtube instead of my RTMP server and I see the same issue on client side.

However I am able to successfully publish the videotestsrc stream to my RTMP server using the command below

gst-launch-1.0 -e videotestsrc ! queue ! videoconvert ! x264enc ! flvmux streamable=true ! queue ! rtmpsink location='rtmp://<my-server>/my-stream/live'

The successful publish logs are as below

Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Redistribute latency... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... Redistribute latency... New clock: GstSystemClock 0:00:44.8 / 99:99:99.

Appreciate in advance any help on the same issue.

0

There are 0 best solutions below