[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

Marton Balint cus at passwd.hu
Tue Jan 7 20:22:35 EET 2020



On Tue, 7 Jan 2020, fgodt wrote:

>
> 在 2020/1/2 22:56, fgodt 写道:
>>
>> 在 2020/1/2 3:39, Marton Balint 写道:
>>>
>>>
>>> On Tue, 31 Dec 2019, fgodt wrote:
>>>
>>>>
>>>> 在 2019/12/31 19:30, Marton Balint 写道:
>>>>>
>>>>>
>>>>> On Tue, 31 Dec 2019, fgodt wrote:
>>>>>
>>>>>>
>>>>>> On 2019/12/31 上午1:37, Calvin Walton wrote:
>>>>>>> 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?
>>>>>> sorry i'm not describe clear. as you say the capture video mouse 
>>>>>> is "manually" paint,
>>>>>>
>>>>>> so the flicker is not the video, but windows mouse cursor. the 
>>>>>> reason is CAPTUREBLT flag
>>>>>>
>>>>>> use to capture layered window, and the animated cursors or 
>>>>>> software cursor became know
>>>>>>
>>>>>> as layered window in Windows. so when we call bitblt with 
>>>>>> CAPTUREBLT windows will hide
>>>>>>
>>>>>> cursor do capture , and then reshow the cursor,this will make 
>>>>>> Windows mouse cursor flicker.
>>>>>>
>>>>>> if user not capture layered window, without CAPTUREBLT flag does 
>>>>>> not change anything.
>>>>>>
>>>>>> see details 
>>>>>> 
> https://docs.microsoft.com/en-us/previous-versions/technet-magazine/dd392008(v=msdn.10)?redirectedfrom=MSDN
>>>>>
>>>>> This is still not the whole story, if you google deeper you should 
>>>>> find that this only affects Windows XP and earlier or Windows 7 if 
>>>>> Aero is disabled.
>>>>>
>>>>> Considering this, I am not sure if we should add this flag, maybe a 
>>>>> warning should be printed instead if Aero is disabled.
>>>>>
>>>> But on my Windows 10 the mouse still flicker when i use CAPTUREBLT 
>>>> flag.
>>>>
>>>
>>> Ok, that is indeed strange, because I always read that on Windows8+ 
>>> the compositor is always enabled.
>>>
>> Ye, i tested on Windows 7 sp1 today the flicker still here, so I think 
>> this flag would be better if it was optional
>>
> So should i resend this patch with clear doc, or just ignore this issue

Yes, please clarify the docs, unfortunately I don't know enough about 
windows/gdi to decide if it is a worthy addition, so I will let others 
decide and apply.

Regards,
Marton


More information about the ffmpeg-devel mailing list