[FFmpeg-devel] [PATCH v3 1/1] avdevice/gdigrab: Add use_captureblt option for disable or use CAPTUREBLT flag, when useing the bitblt function with CAPTUREBLT it caused the mouse cursor flicker. most time we don't need this flag to capture window

Calvin Walton calvin.walton at kepstin.ca
Mon Dec 30 19:37:22 EET 2019

On Mon, 2019-12-30 at 12:31 +0100, Marton Balint wrote:
> On Mon, 30 Dec 2019, fgodtdev at hotmail.com wrote:
> > From: FgoDt <fgodtdev at hotmail.com>
> > + at item use_captureblt
> > +When use gdigrab to capture window or desktop, the mouse cursor
> > will flicker.
> Why? Does this happen with every windows version? This does not seem
> like 
> the right fix. In fact, I dont't see how this can work, because mouse
> is 
> drawn upon the captured video "manually" in paint_mouse_pointer.
> Could you 
> dig deeper what is the main cause of the issue?

I'm guessing that what happens here is that on some OS versions, with
some graphics drivers, the cursor on the *real* display might flicker
while ffmpeg is capturing. I've never actually seen this happen, but if
you have bad/old drivers and have desktop compositing disabled, maybe?

> > +Disable CAPTUREBLT FLAG by set value @code{0} to fix cursor
> > flickering. Default value is @code{1}
> > +
> Doesn't this change what is captured when the user captures a single 
> window and something is dragged on top? That alone might be a useful 
> addition, but the documentation as is would be totally misleading.

Yes, this definitely needs to be clarified in docs.

Another thing to check: If the cursor is included in the captured image
when the CAPTUREBLT flag is disabled, then you should make ffmpeg skip
adding the cursor itself in that case.

Calvin Walton <calvin.walton at kepstin.ca>

More information about the ffmpeg-devel mailing list