Gstreamer shared memory usage

ghizlane ghizlane.boudabza at
Thu May 27 13:47:42 UTC 2021


I have a question regarding the use of shared memories by the gstreamer
shmsink and shmsrc elements.

I run a gstreamer pipeline: videotestsrc and audiotestsrc mixed by mpegts
mixer to a shared memory by the shmsink element like that :

gst-launch-1.0 videotestsrc ! "video/x-raw,width=(int)320, height=(int)240"
! x264enc key-int-max=30 bitrate=2500 ! mux. audiotestsrc ! audio/x-raw !
voaacenc bitrate=192 ! mux. mpegtsmux name=mux ! shmsink
socket-path=/tmp/foo shm-size=10000000 wait-for-connection=false

On reception, first, i launch an rtmp pipeline which receives the stream
from the shared memory via shmsrc and sends it in rtmp to an rtmp up server

 gst-launch-1.0 shmsrc socket-path=/tmp/foo ! tsparse ! tsdemux name=d d. !
h264parse ! queue ! mux. flvmux name=mux ! rtmpsink
location=rtmp://{host}/{key} d. ! aacparse ! queue ! mux.

Second, i run an srt pipeline which reads the stream through shmsrc and
sends it to an srt server :

gst-launch-1.0 shmsrc socket-path=/tmp/foo ! video/mpegts ! queue ! srtsink
uri=srt://{host1}:{port1} mode=caller

The observed result if the srt server is not available is :  the pipeline in
rtmp hangs and i cannot read the stream from shmsink anymore !

PS: I have already checked that the pipeline in srt does not lock the shared

Do you have more information on this subject?

I am looking for examples of functional pipelines, advice or optimizations.

Thank you in advance for your return.


Sent from:

More information about the gstreamer-devel mailing list