After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602834 - [ffmpegcolorspace] does un-necessary conversion from RGB to ARGB
[ffmpegcolorspace] does un-necessary conversion from RGB to ARGB
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.26
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-24 14:53 UTC by Philippe Normand
Modified: 2009-11-25 15:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ffmpegcolorspace: Prefer transforming alpha formats to alpha formats and the other way around (3.12 KB, patch)
2009-11-25 15:19 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Philippe Normand 2009-11-24 14:53:27 UTC
It looks like ffmpegcolorspace converts from RGB to ARGB even if downstream elements support both. This example shows it:

gst-launch -v videotestsrc num-buffers=1 ! "video/x-raw-yuv" ! ffmpegcolorspace ! "video/x-raw-rgb,bpp=(int)32,depth=(int)24,endianness=(int)4321,width=(int)320,height=(int)240,framerate=(fraction)30/1;video/x-raw-rgb,bpp=(int)32,depth=(int)24,endianness=(int)4321,width=(int)320,height=(int)240,framerate=(fraction)30/1,red_mask=(int)65280,green_mask=(int)16711680,blue_mask=(int)-16777216,alpha_mask=(int)255" ! fakesink

fakesink gets these caps: caps = video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, width=(int)320, height=(int)240, framerate=(fraction)30/1, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216
Comment 1 Philippe Normand 2009-11-24 15:00:04 UTC
In the logs:

0:00:00.197728269  3328  0x9ec4518 DEBUG       ffmpegcolorspace gstffmpegcodecmap.c:432:gst_ffmpeg_pixfmt_to_caps: caps for pix_fmt=4: video/x-raw-yuv, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], format=(fourcc)YUY2
0:00:00.198053939  3328  0x9ec4518 DEBUG       ffmpegcolorspace gstffmpegcodecmap.c:432:gst_ffmpeg_pixfmt_to_caps: caps for pix_fmt=13: video/x-raw-rgb, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], bpp=(int)32, depth=(int)24, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, endianness=(int)4321
0:00:00.199234187  3328  0x9ec4518 DEBUG       ffmpegcolorspace gstffmpegcolorspace.c:153:gst_ffmpegcsp_transform_caps:<ffmpegcsp0> transformed video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240, framerate=(fraction)30/1 into video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240, framerate=(fraction)30/1; video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)30/1; video/x-raw-gray, width=(int)320, height=(int)240, framerate=(fraction)30/1; video/x-raw-rgb, width=(int)320, height=(int)240, framerate=(fraction)30/1
0:00:00.199541419  3328  0x9ec4518 DEBUG       ffmpegcolorspace gstffmpegcolorspace.c:246:gst_ffmpegcsp_set_caps: reconfigured 4 13
0:00:00.199638777  3328  0x9ec4518 DEBUG       ffmpegcolorspace gstffmpegcolorspace.c:441:gst_ffmpegcsp_transform: from 4 -> to 13
0:00:00.201696930  3328  0x9ec4518 DEBUG       ffmpegcolorspace gstffmpegcolorspace.c:468:gst_ffmpegcsp_transform: from 4 -> to 13 done
Comment 2 Philippe Normand 2009-11-24 18:59:17 UTC
Sorry description and logs are wrong :P

Pipeline is:

GST_DEBUG=ffmpegcolorspace:4 gst-launch -v videotestsrc num-buffers=1 ! "video/x-raw-yuv" ! ffmpegcolorspace ! "video/x-raw-rgb,bpp=(int)32,depth=(int)24,endianness=(int)4321,width=(int)320,height=(int)240,framerate=(fraction)30/1,red_mask=(int)65280,green_mask=(int)16711680,blue_mask=(int)-16777216;video/x-raw-rgb,bpp=(int)32,depth=(int)32,endianness=(int)4321,width=(int)320,height=(int)240,framerate=(fraction)30/1,red_mask=(int)65280,green_mask=(int)16711680,blue_mask=(int)-16777216,alpha_mask=(int)255" ! fakesink

and in the logs:

fakesink0.GstPad:sink: caps = video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, width=(int)320, height=(int)240, framerate=(fraction)30/1, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255

0:00:00.159230009 29557  0x8fa3600 DEBUG       ffmpegcolorspace gstffmpegcolorspace.c:441:gst_ffmpegcsp_transform: from 4 -> to 9
0:00:00.161144149 29557  0x8fa3600 DEBUG       ffmpegcolorspace gstffmpegcolorspace.c:468:gst_ffmpegcsp_transform: from 4 -> to 9 done
Comment 3 Sebastian Dröge (slomo) 2009-11-25 15:19:08 UTC
Created attachment 148449 [details] [review]
ffmpegcolorspace: Prefer transforming alpha formats to alpha formats and the other way around

Fixes bug #602834 and #350748.
Comment 4 Sebastian Dröge (slomo) 2009-11-25 15:20:30 UTC
commit 1fe9f496911f3139c977e559eb29f60066278165
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed Nov 25 16:17:13 2009 +0100

    ffmpegcolorspace: Prefer transforming alpha formats to alpha formats and the
    
    Fixes bug #602834 and #350748.