<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi All,<div><br></div><div>Thank you very much for your replies!</div><div><br></div><div>In my app I am giving the encoded frames to the app source as fast as possible and properly timestamp. I tried playing with the properties with `gst_app_src_set_max_bytes`, `gst_app_sink_set_max_buffers`; `g_object_set(m_avdec, "max-threads", "1", NULL);` but it did not change the cpu usage. In principle no video conversion is done. I just grab the yuv textures from the appsink and can display them, or dump them to disk.</div><div><br></div><div>I tried changing the avdec_h265 by vaapih265dec, but it seems I don't have it since I get `No such element or plugin 'vaapih265dec'`. I tried to install it with `sudo apt install va-driver-all gstreamer1.0-vaapi` but it still does not appear with gst-inspect.</div><div><br></div><div>One thing I noticed is that if I change avdec_h265 to libde265dec, it seems to run more smoothly. Maybe there is an issue on how I compile libav? That does not affect the gst-launch command?</div><div><br></div><div>I'll keep looking into it.</div><div><br></div><div>Cheers,</div><div>Sergio</div><div><br></div><div><br></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 26 Jul 2022 at 13:26, Tim-Philipp Müller 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>On Tue, 2022-07-26 at 09:36 +0200, Sergio González via gstreamer-devel wrote:</div><div><br></div><div>Hi Sergio,</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div>appsrc ! queue ! typefind ! h265parse ! capsfilter ! avdec_h265 ! queue ! videoconvert ! queue ! appsink</div><div><br></div><div>What I am observing is that when I push buffers to the appsrc, if the decoding components are linked, there is a high surge of CPU consumption (as in, 12 of the 16 cores are at 100%). However, if on the same machine I just execute the same pipeline with gst-launch, the cpu usage is way more reasonable and the decoding goes smoothly.</div></div></blockquote><div><br></div><div>How do you feed buffers into appsrc? Time-based (e.g. 60 buffers per second) or as fast as possible?</div><div><br></div><div>appsink has an unlimited queue internally, so if you feed buffers as fast as possible on the source side, nothing will throttle the decoding until you run out of memory. You can set appsink max-buffers=5 or so to work around that.</div><div><br></div><div>Do you force video conversion after the decoder (via caps on the appsink) that you don't get in a playback pipeline?</div><div><br></div><div>Do you put proper timestamps on the buffers you push into appsrc, or how is the data timestamped?</div><div><br></div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div>Adding a Probe to the sink and the source pads of the avdec_h265 tells me that the time between decoding buffers at the beginning is of about 200ms, but as app keeps decoding, it soon reaches 600ms.</div></div></blockquote><div><br></div><div>That sounds like the appsrc/sink pipeline is decoding at a slower rate than realtime? (But at the same time using much more cpu?)</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div>Do you have some insight on what might cause this? Maybe I am missing some property in some of the components?</div></div></blockquote><div><br></div><div>There are properties on avdec_h265 that you can play with, like thread-type=slice or max-threads=X but if the defaults are used in both cases that doesn't really explain the difference in behaviour.</div><div><br></div><div>Cheers</div><div> Tim</div><div><br></div><div><span></span></div></div>
</blockquote></div>