<div dir="auto"><div>Did you try to get the raw frames from your webcam and use SW/HW H264 encoder to encode it for the muxer?</div><div dir="auto"><br></div><div dir="auto">or allow "leacky" to the audio queue?</div><div dir="auto"><br></div><div dir="auto">Yu<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Mon, 16 Aug 2021, 15:46 James via gstreamer-devel, <<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:24px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br><blockquote type="cite"><blockquote style="margin:0 0 0 40px;border:none;padding:0px">Utter frustration:<br><br>I have a script<br><br>#! /bin/bash<br><br>GST_DEBUG_DUMP_DOT_DIR=/home/jam/DOT gst-launch-1.0 $@ v4l2src device=/dev/video2 ! \<br><span style="white-space:pre-wrap">  </span>video/x-h264,width=1920,height=1080,framerate=30/1 ! \<br><span style="white-space:pre-wrap">        </span>h264parse ! \<br><span style="white-space:pre-wrap"> </span>tee name=t \<br><span style="white-space:pre-wrap">  </span>t. ! queue ! avdec_h264 ! xvimagesink sync=false \<br><span style="white-space:pre-wrap">    </span>t. ! queue ! avdec_h264 ! xvimagesink sync=true \<br><span style="white-space:pre-wrap">     </span>t. !  queue max-size-buffers=0 max-size-bytes=0 max-size-time=1000000000 ! \<br><span style="white-space:pre-wrap"> </span>mux. pulsesrc device=0 ! \<br><span style="white-space:pre-wrap">    </span>queue ! \<br><span style="white-space:pre-wrap">     </span>audioconvert ! \<br><span style="white-space:pre-wrap">      </span>audioresample ! audio/x-raw, rate=16000 ! \<br><span style="white-space:pre-wrap">   </span>queue ! \<br><span style="white-space:pre-wrap">     </span>avenc_aac ! \<br><span style="white-space:pre-wrap"> </span>queue ! \<br><span style="white-space:pre-wrap">     </span>mux. mp4mux name=mux ! \<br><span style="white-space:pre-wrap">      </span>filesink location=try9.mp4<br><br>and a C version that behaves pretty much identically.<br><br>Running the script on its own I have never seen it fail.<br>My app is a QT5 gui. Running my app AND the script OR the compiled version by QProcess sometimes fails with the dreaded pulsesrc underflow, downstream consuming too slowly message.<br>If it fails, it always fails until reboot.<br><br>htop shows cpu usage of 10..30% 5..6G ram as cache and 0 swap being used.<br>gnome-system-monitor shows no spikes in cpu usage.<br>In desperation I swapped my 2 core i3 for a 4 core i7. Behaviour was the same.<br><br>At other times it works for hours, many times in a row.<br><br>What measurements might I make that may lead me to the problem.<br><br>Needless to say if I leave the tee multiplex (and hence pulsesrc) out of the pipline then it never fails.<br>I've tried mp4mux, qtmux and (by accident) mpegtsmux without any change being visible. I tried matuska but that fails everytime.</blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote><br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>This gets more outlandish:<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>App->record: error after 25sec<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>App->quit<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>Script->record: all ok<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>App->start<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>Script stop<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>App->record: all ok<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>Repeatable, tried lots of times !!!<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>Note<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>App->record: error<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>App->idle<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"></blockquote>Script->record: error every time.<br><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:24px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;display:inline!important;float:none">cpu usage never goes over 40%</span><br></blockquote><br><div>On the chance someone recognises detail I post. This is playing a *bad* file:</div><div><br></div><div><div>VLC error list</div><div><br></div><div>[00007fd5accd5840] main decoder error: Could not convert timestamp 2456057878 for FFmpeg</div><div>[00007fd5accd5840] main decoder error: Timestamp conversion failed (delay 1000000, buffering 100000, bound 9000000)</div><div>[00007fd5accd5840] main decoder error: Could not convert timestamp 2456093211 for FFmpeg</div><div><br></div><div>MPlayer error list</div><div><br></div><div>libavformat file format detected.</div><div>[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa17f53b7a0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol</div><div>[lavf] stream 0: video (h264), -vid 0</div><div>==========================================================================</div><div>AO: [pulse] 16000Hz 2ch floatle (4 bytes per sample)</div><div>Starting playback...</div><div>Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.</div><div><br></div><div>Possibly bad interleaving detected.</div><div>Use -ni option if this causes playback issues and avoid or fix the program that created the file.</div><div>A: 153.6 V: 163.6 A-V: -9.965 ct: -0.587   0/  0 53%  1%  0.2% 0 0</div><div><br></div></div><div>Still trying to find out what happens when the system is in *bad* mode vs *good* mode</div><div>James</div></div></blockquote></div></div></div>