<div dir="ltr">Hi<div><br></div><div>I opened a separate thread about queueing the muxed data, so here the the question that remained is what am I doing wrong when I try to block and unblock the two separate queues before the mux. </div><div><br></div><div>Is there any material I should read through in more detail? Or do you have any advice where I should look in the logs since right now i'm a bit lost. </div><div><br></div><div>I tried to execute the blockin and blockings of the pads serially(block the second queue from the first's callback) and in parallel but that did not help. Or what i'm trying to do is conceptually wrong?</div><div><br></div><div>Thanks!</div><div><br></div><div>Peter</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 7, 2020 at 12:00 AM Peter Biro <<a href="mailto:pettair@gmail.com">pettair@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi,<div><br></div><div><div><br></div><div>I refactored my project based on Tim's examples, which works perfectly when the pipeline contains only a video source, although I found one strange thing in the behaviour: </div><div>the blocking of a pad work only in cases when there is a "tee" between the source and the blocked element, otherwise it will block the other parts of the pipeline (so I added on extra(unnecessary?) tee for the audio). Is this expected or I do something not properly?  </div><div><br></div><div>But when I add an audio source things are getting a bit more complicated.</div><div><br></div><div>So I added the audio and moved the cacheing/buffering queue  after the muxer () . But this way it generates invalid file on the output (VLC show this kind of issues: "ps warning: this does not look like an MPEG PS stream, continuing anyway; ps warning: garbage at input from 509, trying to resync...")</div><div><br></div><div><div style="color:rgb(54,54,54);background-color:rgb(255,255,255);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:800;font-size:10px;line-height:15px;white-space:pre-wrap"><div><span style="color:rgb(162,86,55)">nvarguscamerasrc sensor-id=0 sensor-mode=0</span></div><div><span style="color:rgb(162,86,55)">      ! video/x-raw(memory:NVMM), width=(int)1980, height=(int)1080, format=(string)NV12, framerate=(fraction)20/1 </span></div><div><span style="color:rgb(162,86,55)">      ! nvvidconv ! textoverlay name=text_overlay ! video/x-raw,format=I420 ! nvvidconv ! nvv4l2vp8enc ! tee name=video_stream_spilt</span></div><div><span style="color:rgb(162,86,55)">      audiotestsrc ! vorbisenc ! queue ! file_sink_video_mux.</span></div><div><span style="color:rgb(162,86,55)">      video_stream_spilt. ! queue ! webmmux name=file_sink_video_mux ! tee name=muxed_video_stream_spilt</span></div><div><span style="color:rgb(162,86,55)">      muxed_video_stream_spilt. ! queue name=file_sink_queue ! filesink name=file_sink location=/tmp/video_out.webm</span></div><div><span style="color:rgb(162,86,55)">      muxed_video_stream_spilt. ! fakesink</span></div><div><span style="color:rgb(162,86,55)">      video_stream_spilt. ! rtpvp8pay mtu=1400 ! appsink name=app_sink</span></div></div></div><div><br></div><div>I tried to google around, but I not found any similar examples so I guess I cannot "buffer" muxed packets with a queue. Is this approach fundamentally wrong?</div><div><br></div><div>After this I tried to add queues before the mux, but this way the pipeline stops when Im unblocking the pads. <br><div><br></div><div><div style="color:rgb(54,54,54);background-color:rgb(255,255,255);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:800;font-size:10px;line-height:15px;white-space:pre-wrap"><div><span style="color:rgb(162,86,55)">nvarguscamerasrc sensor-id=0 sensor-mode=0</span></div><div><span style="color:rgb(162,86,55)">      </span><span style="color:rgb(162,86,55)">! video/x-raw(memory:NVMM), width=(int)1980, height=(int)1080, format=(string)NV12, framerate=(fraction)20/1 </span></div><div><span style="color:rgb(162,86,55)">      ! nvvidconv ! textoverlay name=text_overlay ! video/x-raw,format=I420 ! nvvidconv ! nvv4l2vp8enc ! tee name=video_stream_spilt </span></div><div><span style="color:rgb(162,86,55)">      audiotestsrc ! vorbisenc ! tee name=audio_stream_spilt</span></div><div><span style="color:rgb(162,86,55)">      audio_stream_spilt. ! queue name=file_sink_audio_queue ! file_sink_video_mux.</span></div><div><span style="color:rgb(162,86,55)">      audio_stream_spilt. ! fakesink</span></div><div><span style="color:rgb(162,86,55)">      video_stream_spilt. ! queue name=file_sink_video_queue ! webmmux name=file_sink_video_mux ! filesink name=file_sink location=/tmp/video_out.webm</span></div><div><span style="color:rgb(162,86,55)">      video_stream_spilt. ! rtpvp8pay mtu=1400 ! appsink name=app_sink</span></div></div></div><div><br></div><div>I will attach the debug output, the corresponding part comes after the "<span style="color:rgb(54,54,54);font-family:Menlo,Monaco,"Courier New",monospace;font-size:10px;font-weight:800;white-space:pre-wrap;background-color:rgb(255,255,255)">startRecording: dcd - startRecording</span>" log message. Im sure that im doing something wrong, since I think this should work. </div><div><br></div><div>Do you have any idea what am I doing wrong?</div><div><br></div><div>Thank you!</div><div><br></div><div></div></div></div></div><div style="overflow-wrap: break-word;"><div><div><div></div><div><br><blockquote type="cite"><div>On 2020. Dec 2., at 21:27, Peter Biro <<a href="mailto:pettair@gmail.com" target="_blank">pettair@gmail.com</a>> wrote:</div><br><div><div>Hi Tim.<br><br>Thanks for the examples!<br><br>I think I tried something similar before but as I remember when I set the state on the filesink (to be able to change the location) to GST_STATE_NULL it was propagated trough the pipeline and it caused glitches in the streaming. <br><br>As I see you do kind of the same here with the 'autovideosink' and I guess you are not experience such thing since you block the pad on 'vrecq' to block? <br><br>Bests,<br>Peter<br><br><blockquote type="cite">On 2020. Dec 2., at 0:30, Tim Müller <<a href="mailto:tim@centricular.com" target="_blank">tim@centricular.com</a>> wrote:<br><br>Hi Peter,<br><br>I have an example for save-to-file-with-backlog here:<br><br><a href="https://people.freedesktop.org/~tpm/code/test-backlog-recording-h264.c" target="_blank">https://people.freedesktop.org/~tpm/code/test-backlog-recording-h264.c</a><br><br>or (rtp variant):<br><br><a href="https://people.freedesktop.org/~tpm/code/test-backlog-recording-h264-rtp.c" target="_blank">https://people.freedesktop.org/~tpm/code/test-backlog-recording-h264-rtp.c</a><br><br>for what it's worth.<br><br>And audiomixer element can produce silence samples if it operates in<br>live mode, which will happen if the upstream source is a live/capture<br>source or you force it into live mode with a dummy audiotestsrc is-<br>live=true branch.<br><br> Alternatively  .. ! interaudiosink   interaudiosrc ! ...<br><br>Cheers<br>Tim<br><br>-- <br>Tim Müller, Centricular Ltd - <a href="http://www.centricular.com" target="_blank">http://www.centricular.com</a><br><br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br></blockquote><br></div></div></blockquote></div><br></div></div></div></blockquote></div>