#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)
Change History (11)
by , 14 years ago
Attachment: | out20110506.png added |
---|
by , 14 years ago
Attachment: | out20110506.jpg added |
---|
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Priority: | normal → minor |
---|---|
Reproduced by developer: | set |
Status: | new → open |
Version: | git → git-master |
Work-around is to use -pix_fmt rgb24
Not a regression, afaict.
comment:3 by , 13 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 , 13 years ago
Analyzed by developer: | set |
---|---|
Component: | undetermined → avdevice |
But am I correct that x11grab should not assume a useful value for the alpha channel of bgra?
comment:5 by , 13 years ago
Summary: | png output creates artifacts or blank image with x11grab input → x11grab input returns fully transparent image |
---|
comment:6 by , 13 years ago
Keywords: | rgb32 alpha transparent added; png removed |
---|
by , 13 years ago
Attachment: | ticket163.png added |
---|
comment:8 by , 13 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.
Tested on x86_64 Arch Linux.