Bug #1204
rsbvideosink lies about pixel format for video/x-raw-rgb mime-type
Status: | Resolved | Start date: | 10/12/2012 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | J. Moringen | % Done: | 100% | |
Category: | - | |||
Target version: | Robotics Service Bus - rsb-0.9 |
Description
In parallel launch:
gst-launch-0.10 gconfvideosrc ! video/x-raw-rgb ! queue ! rsbvideosink "scope=/video" gst-launch-0.10 rsbvideosrc "scope=/video" ! ffmpegcolorspace ! queue ! xvimagesink
The received images in the second pipeline have broken colors.
Associated revisions
Improved caps negotiation in src/gst_rsb_video_sink.{h,cpp}
fixes #1204
In GStreamer, the RGB and BGR pixel format both correspond to mimetype
video/x-raw-rgb. To distinguish the two, the {red,green,blue}_masks
have to be used.
- src/gst_rsb_video_sink.{h,cpp}: updated copyright
(gst_rsb_video_sink_sink_factory): fixed existing static caps entry
for video/x-raw-rgb by adding channels masks for RGB pixel format;
added entry for video/x-raw-rgb with channels masks for BGR pixel
format; added entry for video/x-raw-gray
(gst_rsb_video_sink_init): adapted member initialization
(gst_rsb_video_sink_set_caps): process channel masks for
video/x-raw-rgb; handle video/x-raw-gray
For video/x-raw-rgb, masks in caps in src/gst_rsb_video_src.{h,cpp}
refs #1204
For video/x-raw-rgb mime-type, include {red,green,blue} masks and
export in exported caps to prevent downstream elements from
interpreting data with wrong pixel format.
- src/gst_rsb_video_src.{h,cpp} (gst_rsb_video_src_set_format):
determine {red,green,blue} masks and export in caps
Backport: Improved caps negotiation in src/gst_rsb_video_sink.{h,cpp}
refs #1204
In GStreamer, the RGB and BGR pixel format both correspond to mimetype
video/x-raw-rgb. To distinguish the two, the {red,green,blue}_masks
have to be used.
- src/gst_rsb_video_sink.{h,cpp}: updated copyright
(gst_rsb_video_sink_sink_factory): fixed existing static caps entry
for video/x-raw-rgb by adding channels masks for RGB pixel format;
added entry for video/x-raw-rgb with channels masks for BGR pixel
format; added entry for video/x-raw-gray
(gst_rsb_video_sink_init): adapted member initialization
(gst_rsb_video_sink_set_caps): process channel masks for
video/x-raw-rgb; handle video/x-raw-gray
Backport: For video/x-raw-rgb, masks in caps in src/gst_rsb_video_src.{h,cpp}
refs #1204
For video/x-raw-rgb mime-type, include {red,green,blue} masks and
export in exported caps to prevent downstream elements from
interpreting data with wrong pixel format.
- src/gst_rsb_video_src.{h,cpp} (gst_rsb_video_src_set_format):
determine {red,green,blue} masks and export in caps
Fixed channel mask fuckup in src/gst_rsb_video_{src,sink}.cpp
After the previous "fixes" (in 9e4cb9e and a6c82d3), the color
channels masks for bgr and rgb were reversed. To add insult to injury,
there was a programming error of confusing the = and operators.
refs #1182, refs #1194, refs #1204
- src/gst_rsb_video_src.cpp (gst_rsb_video_sink_set_caps): reversed
channel masks for rgb and bgr; added warning if channels masks are
missing, although this should not happen; fixed = vs. confusion - src/gst_rsb_video_sink.cpp (gst_rsb_video_src_set_format): similar
History
#1 Updated by J. Wienke over 11 years ago
- Subject changed from Unable to correctly replay images sent using the rsb sink in bgr to Unable to correctly replay images sent using the rsb sink in rgb
#2 Updated by J. Moringen over 11 years ago
I cannot reproduce this (with the master version, but there should be no difference).
Your gconfvideo{src,sink}
may be differently configured than mine. Please provide a tide log file containing the data generated by your first pipeline.
#3 Updated by J. Wienke over 11 years ago
- File brokenvideo.tide added
Attached is a file, I have reduced the video size to 320x240, but the problem still exists.
#4 Updated by J. Wienke over 11 years ago
The suspicion is that images sent over the sink are declared rgb, but actually contain bgr data.
#5 Updated by J. Moringen over 11 years ago
- Status changed from New to In Progress
- Target version changed from rsb-0.7 to rsb-0.9
- % Done changed from 0 to 70
#6 Updated by J. Moringen over 11 years ago
- Subject changed from Unable to correctly replay images sent using the rsb sink in rgb to rsbvideosink lies about pixel format for video/x-raw-rgb mime-type
#7 Updated by J. Moringen over 11 years ago
- Status changed from In Progress to Resolved
- % Done changed from 70 to 100
Applied in changeset rsb-gstreamer|commit:d9f315bc1225c52fde9ff501947f78b213dff065.
#8 Updated by J. Moringen over 11 years ago
- File screenshot.png added
- Status changed from Resolved to Feedback
After d9f315bc1225c52fde9ff501947f78b213dff065, when displayed via
gst-launch-0.10 rsbvideosrc ! ffmpegcolorspace ! gconfvideosink
the frames from the attached log file look like this:
Should be OK, right?
#9 Updated by J. Wienke over 11 years ago
Looks fine
#10 Updated by J. Moringen over 11 years ago
- Status changed from Feedback to Resolved