Opened 4 years ago
Last modified 4 years ago
#8744 new defect
Transparency problem when capturing a window with gdigrab
Reported by: | sacereda | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avdevice |
Version: | git-master | Keywords: | gdigrab alpha |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
When capturing a windows explorer window with gdigrab, the effect is like a black layer layer with some transparency in front of the content and the result is not the same as the source.
This problem doesn't occur when capturing Desktop (instead of title=XXX).
How to reproduce:
% Open a windows explorer window (win+r Documents enter) % ffmpeg.exe -f gdigrab -i "title=Documents" ffmpeg version 4.2.3 (also occur in 4.0 version) built with gcc 9.3.1 (GCC) 20200523
Attachments (4)
Change History (11)
by , 4 years ago
Attachment: | ffmpeg-20200617-212928.log added |
---|
by , 4 years ago
Attachment: | gdigrab-transparency.JPG added |
---|
screenshot comparing ffplay output and source window
comment:1 by , 4 years ago
Keywords: | alpha added; transparency removed |
---|---|
Version: | 4.2 → unspecified |
Please test current FFmpeg git head, the only version supported on this bug tracker.
comment:3 by , 4 years ago
Version: | unspecified → git-master |
---|
Please test the following command line and attach the output file here:
$ ffmpeg -f gdigrab -i "title=Documents" -v:frames 1 -vcodec copy -f rawvideo out.bmp
comment:4 by , 4 years ago
With '-f rawvideo' the filesize keeps growing and doesn't seem to end (I cancelled when reached 6GB).
Do you want me to upload the bmp file without the rawvideo option?
comment:5 by , 4 years ago
Sorry, I copied your command line, please do the following:
$ ffmpeg -f gdigrab -i "title=Documents" -vframes 1 -vcodec copy -f rawvideo out.bmp
comment:6 by , 4 years ago
You did provide ffmpeg -i
console output for the issue you reported but you did not provide a command line that allows to reproduce the issue you reported.
Are you reporting an issue that is only reproducible with ffplay
, not with ffmpeg
?
comment:7 by , 4 years ago
Hi,
If I open the attached copy-rawvideo.bmp file with xnview or similar, most of pixels have alpha component to zero. Format is detected as BGRA, but some parts of the window are "covered" (alpha 0) and doesn't reproduce the original content (check gdigrab-transparency.jpg)
You can reproduce it both with ffplay and ffmpeg:
% ffplay -f gdigrab -i "title=Documents"
% ffmpeg -f gdigrab -i "title=Documents" -vframes 1 output.png
In our software (using ffmpeg 4.0), we handle alpha channel and the behaviour is the same as in ffplay.
Let me know if you need further info, or if I can help in any way.
Output log