<html><head></head><body><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:0 0 0 .8ex; border-left:2px #729fcf solid;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:0 0 0 .8ex; border-left:2px #729fcf solid;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:0 0 0 .8ex; border-left:2px #729fcf solid;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></body></html>