<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi, I have a pipeline that receives a video stream using from an application appsrc and streams that stream to a WebRTC client. At the same time, the pipeline attempts to save the video to a file (as MP4 but could also be Matroska etc) in a separate branch using the tee command. The pipeline is created programmatically using gst_parse_launch and looks as follows:<br></div><div><br></div><div>webrtcbin bundle-policy=max-bundle name=myserver stun-server=stun://global.stun.twilio.com:3478?transport=udp 
appsrc name=TextureSource-1 ! videoconvert ! video/x-raw,format=I420 ! x264enc name=VideoEncoder-1 tune=zerolatency 
speed-preset=superfast ! tee name=t ! queue ! video/x-h264,stream-format=byte-stream ! 
filesink location=capture.mp4 t. ! queue ! rtph264pay ! 
application/x-rtp,media=video,encoding-name=H264,payload=96 ! myserver.
<br></div><div><br></div><div>I can receive the stream without issues on my WebRTC client but the problem is, the saved MP4 file is mostly unplayable. Somehow, I can only play the file using ffplay which plays it at approximately twice the speed of the capture rate. After some web search, I found out that I need to send an EOS event to the pipeline (so that the MP4 header could be written properly and the file becomes playable) through a command like: <br></div><div><br></div><div>gst_element_send_event(m_pPipeline, gst_event_new_eos()); <br></div><div><br></div><div>where m_pPipeline is a pointer to my pipeline element.<br></div><div><br></div><div>However, on my bus I never get a message of type GST_MESSAGE_EOS which, in my understanding, means that the EOS message somehow does not travel downstream to my sinks. I tried to add the "message-forward" parameter using g_object_set (G_OBJECT(m_pPipeline), "message-forward", true, nullptr); but I observed the same behaviour.<br></div><div><br></div><div>What am I doing wrong here, should the EOS message not directly be sent to the pipeline but to the individual sinks (in this case filesink and webrtcbin)? Is there anything specific to webrtcbin that prevents receiving the EOS message?<br></div><div><br></div><div>Thank you for your help.<br></div><div><br></div><div id="sig67116920"><div class="signature">-- <br></div><div class="signature">  Serhan Gül<br></div><div class="signature">  <a href="mailto:serhan@fastmail.com">serhan@fastmail.com</a><br></div><div class="signature"><br></div></div><div><br></div></body></html>