[FFmpeg-devel] [PATCH] lavd/xcbgrab: do not try to create refcounted packets.

Sven C. Dack sven.c.dack at sky.com
Tue Oct 25 21:10:48 EEST 2016

On 23/10/16 13:29, Nicolas George wrote:
> The framework will allocate a buffer and copy the data to it,
> that takes time. But it avoids constently creating and
> destroyng the shared memory segment, and that saves more time.
> On my setup,
> from ~200 to ~300 FPS at full screen (1920×1200),
> from ~1400 to ~3300 at smaller size (640×480),
> similar to legacy x11grab.
> Plus, shared memory segments are a scarce resource,
> allocating potentially many is a bad idea.
> Note: if the application were to drop all references to the
> buffer before the next call to av_read_frame(), then passing
> the shared memory segment as a refcounted buffer would be
> even more efficient, but it is hard to guarantee, and it does
> not happen with the ffmpeg command-line tool. Using a small
> number of preallocated buffers and resorting to a copy when
> the pool is exhausted would be a solution to get the better
> of both worlds.

192fps -> 315fps (+64%)


More information about the ffmpeg-devel mailing list