How to use Gstreamer to ingress live stream on Azure Media Services using RTMP in a long run?

Cross-posting on Microsoft Q&A

With some inspiration from another post, I can successfully have a live stream on Azure Media Services Basic Pass-through Live Event using Gstreamer and RTMP.

However, it won’t stay for long. I want to have the stream working 24/7, but after some hours, the preview and the egress output get more and more buffering/loading with many browser console 404 errors.

I suspect that it is because I restart the stream once every 6 hours? How can I fix that?

Here is my Gstreamer command:

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=640, height=480, format=BGR \                                                                                                 
    ! vspmfilter dmabuf-use=true ! video/x-raw, format=NV12 \                                                                                                                                
    ! omxh264enc control-rate=2 target-bitrate=10485760 \                                                                                                                                    
    ! video/x-h264,profile=\(string\)high,level=\(string\)4.2 \                                                                                                                              
    ! h264parse config-interval=-1 \                                                                                                                                                         
    ! mux. audiotestsrc is-live=true wave=silence ! audio/x-raw,rate=48000 ! faac bitrate=96000 ! aacparse ! audio/mpeg, mpegversion=4! mux. flvmux streamable=true name=mux \               
    ! rtmpsink location="${dest} live=1 flashver=FMLE/3.0(compatibble;FMSc/1.0)" 

Leave a Comment