<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On 17 Aug 2021, at 5:25 am, Yu You via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div dir="auto" class=""><div class="">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" class=""><br class=""></div><div dir="auto" class="">or allow "leacky" to the audio queue?</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">Yu<br class=""><br class=""><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" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br class=""></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" class=""><br style="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;" class=""><br class=""><blockquote type="cite" class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="">Utter frustration:<br class=""><br class="">I have a script<br class=""><br class="">#! /bin/bash<br class=""><br class="">GST_DEBUG_DUMP_DOT_DIR=/home/jam/DOT gst-launch-1.0 $@ v4l2src device=/dev/video2 ! \<br class=""><span style="white-space:pre-wrap" class="">    </span>video/x-h264,width=1920,height=1080,framerate=30/1 ! \<br class=""><span style="white-space:pre-wrap" class="">  </span>h264parse ! \<br class=""><span style="white-space:pre-wrap" class="">   </span>tee name=t \<br class=""><span style="white-space:pre-wrap" class="">    </span>t. ! queue ! avdec_h264 ! xvimagesink sync=false \<br class=""><span style="white-space:pre-wrap" class="">      </span>t. ! queue ! avdec_h264 ! xvimagesink sync=true \<br class=""><span style="white-space:pre-wrap" class="">       </span>t. !  queue max-size-buffers=0 max-size-bytes=0 max-size-time=1000000000 ! \<br class=""><span style="white-space:pre-wrap" class="">       </span>mux. pulsesrc device=0 ! \<br class=""><span style="white-space:pre-wrap" class="">      </span>queue ! \<br class=""><span style="white-space:pre-wrap" class="">       </span>audioconvert ! \<br class=""><span style="white-space:pre-wrap" class="">        </span>audioresample ! audio/x-raw, rate=16000 ! \<br class=""><span style="white-space:pre-wrap" class="">     </span>queue ! \<br class=""><span style="white-space:pre-wrap" class="">       </span>avenc_aac ! \<br class=""><span style="white-space:pre-wrap" class="">   </span>queue ! \<br class=""><span style="white-space:pre-wrap" class="">       </span>mux. mp4mux name=mux ! \<br class=""><span style="white-space:pre-wrap" class="">        </span>filesink location=try9.mp4<br class=""><br class="">and a C version that behaves pretty much identically.<br class=""><br class="">Running the script on its own I have never seen it fail.<br class="">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 class="">If it fails, it always fails until reboot.<br class=""><br class="">htop shows cpu usage of 10..30% 5..6G ram as cache and 0 swap being used.<br class="">gnome-system-monitor shows no spikes in cpu usage.<br class="">In desperation I swapped my 2 core i3 for a 4 core i7. Behaviour was the same.<br class=""><br class="">At other times it works for hours, many times in a row.<br class=""><br class="">What measurements might I make that may lead me to the problem.<br class=""><br class="">Needless to say if I leave the tee multiplex (and hence pulsesrc) out of the pipline then it never fails.<br class="">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" class=""></blockquote><br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>This gets more outlandish:<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>App->record: error after 25sec<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>App->quit<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>Script->record: all ok<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>App->start<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>Script stop<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>App->record: all ok<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>Repeatable, tried lots of times !!!<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>Note<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>App->record: error<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>App->idle<br class=""><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""></blockquote>Script->record: error every time.<br class=""><span style="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; float: none; display: inline !important;" class="">cpu usage never goes over 40%</span><br class=""></blockquote><br class=""><div class="">On the chance someone recognises detail I post. This is playing a *bad* file:</div><div class=""><br class=""></div><div class=""><div class="">VLC error list</div><div class=""><br class=""></div><div class="">[00007fd5accd5840] main decoder error: Could not convert timestamp 2456057878 for FFmpeg</div><div class="">[00007fd5accd5840] main decoder error: Timestamp conversion failed (delay 1000000, buffering 100000, bound 9000000)</div><div class="">[00007fd5accd5840] main decoder error: Could not convert timestamp 2456093211 for FFmpeg</div><div class=""><br class=""></div><div class="">MPlayer error list</div><div class=""><br class=""></div><div class="">libavformat file format detected.</div><div class="">[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 class="">[lavf] stream 0: video (h264), -vid 0</div><div class="">==========================================================================</div><div class="">AO: [pulse] 16000Hz 2ch floatle (4 bytes per sample)</div><div class="">Starting playback...</div><div class="">Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.</div><div class=""><br class=""></div><div class="">Possibly bad interleaving detected.</div><div class="">Use -ni option if this causes playback issues and avoid or fix the program that created the file.</div><div class="">A: 153.6 V: 163.6 A-V: -9.965 ct: -0.587   0/  0 53%  1%  0.2% 0 0</div><div class=""><br class=""></div></div><div class="">Still trying to find out what happens when the system is in *bad* mode vs *good* mode</div></div></blockquote></div></div></div></div></blockquote><br class=""></div><div><br class=""></div><div>OK lots of testing: here are some answers since the irony of the title must intrigue</div><div><br class=""></div><div>First I wrote my recording code as a daemon (to sever all links to the app)</div><div><br class=""></div><div>now on an clean system dvrRecord always works</div><div><br class=""></div><div>With QT app running dvrRecord always fails</div><div><br class=""></div><div>With a clean system dvrRecord then App works and continues working.</div><div><br class=""></div><div>after App dvrRecord always works</div><div><br class=""></div><div>The only way (there may be others I don't see) that I see the App having on dvrRecord is address in memory that is being used, but by magic smoke every process has memory from 0..NNNN no matter where in physical memory the process resides. The obvious question: I repeat the results on completely different hardware.</div><div><br class=""></div><div>The time to fail is always 26 secs into the recording:</div><div>soundsoundsound<click>0.5secsound  0.5sec_pause 0.5secsound 0.5sec_pause . . .</div><div>James</div></body></html>