Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#163 closed defect (fixed)

x11grab input returns fully transparent image

Reported by: llogan Owned by:
Priority: minor Component: avdevice
Version: git-master Keywords: x11grab, rgb32, alpha, transparent
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

jpg output works as expected. out20110506.png attached.

$ ffmpeg -f x11grab -r 25 -s 800x600 -i :0.0 -vframes 1 out20110506.png
ffmpeg version git-N-29638-g95f163b, Copyright (c) 2000-2011 the FFmpeg developers
  built on May  6 2011 14:01:20 with gcc 4.6.0 20110415 (prerelease)
  configuration: --prefix=/usr --disable-optimizations --enable-x11grab --enable-gpl
  libavutil    51.  2. 1 / 51.  2. 1
  libavcodec   53.  3. 0 / 53.  3. 0
  libavformat  53.  0. 3 / 53.  0. 3
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  4. 0 /  2.  4. 0
  libswscale    0. 14. 0 /  0. 14. 0
[x11grab @ 0x1aacd40] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 800 height: 600
[x11grab @ 0x1aacd40] shared memory extension found
[x11grab @ 0x1aacd40] Estimating duration from bitrate, this may be inaccurate
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1304719812.085890, bitrate: 384000 kb/s
    Stream #0.0: Video: rawvideo, bgra, 800x600, 384000 kb/s, 25 tbr, 1000k tbn, 25 tbc
[buffer @ 0x1abb160] w:800 h:600 pixfmt:bgra
Output #0, image2, to 'out20110506.png':
  Metadata:
    encoder         : Lavf53.0.3
    Stream #0.0: Video: png, bgra, 800x600, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=    1 fps=  0 q=0.0 Lsize=      -0kB time=0.04 bitrate=  -4.4kbits/s    
video:72kB audio:0kB global headers:0kB muxing overhead -100.029685%

Attachments (3)

out20110506.png (52.7 KB ) - added by llogan 11 years ago.
out20110506.jpg (51.6 KB ) - added by llogan 11 years ago.
ticket163.png (162.3 KB ) - added by llogan 11 years ago.

Download all attachments as: .zip

Change History (11)

by llogan, 11 years ago

Attachment: out20110506.png added

by llogan, 11 years ago

Attachment: out20110506.jpg added

comment:1 by llogan, 11 years ago

Tested on x86_64 Arch Linux.

comment:2 by Carl Eugen Hoyos, 11 years ago

Priority: normalminor
Reproduced by developer: set
Status: newopen
Version: gitgit-master

Work-around is to use -pix_fmt rgb24

Not a regression, afaict.

comment:3 by reimar, 11 years ago

FFmpeg captures with alpha channel, though RGB32 for X does not usually include alpha but instead has a constant 0.
That constant 0 ends up as "fully transparent" in the png.
If you remove the alpha channel (e.g. in GIMP decompose as RGB and then compose again) you will see the image is there.
-pix_fmt rgb24 is of course a better way to get the same effect.

comment:4 by Carl Eugen Hoyos, 11 years ago

Analyzed by developer: set
Component: undeterminedavdevice

But am I correct that x11grab should not assume a useful value for the alpha channel of bgra?

comment:5 by Michael Niedermayer, 11 years ago

Summary: png output creates artifacts or blank image with x11grab inputx11grab input returns fully transparent image

comment:6 by Michael Niedermayer, 11 years ago

Keywords: rgb32 alpha transparent added; png removed

comment:7 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

Should be fixed.

by llogan, 11 years ago

Attachment: ticket163.png added

comment:8 by llogan, 11 years ago

Thanks for the patch. It create a normal output on Arch Linux, but in an Ubuntu Oneiric 11.10 VM there are still some transparency artifacts, but I'm not sure why. Example attached as ticket163.png.

Note: See TracTickets for help on using tickets.