opencv: extracting video channels and depth from caps
Sebastian Dröge
sebastian at centricular.com
Mon Oct 24 06:45:02 UTC 2016
On Sun, 2016-10-23 at 09:44 +0000, philippe renon wrote:
> Hi,
>
> The opencv plugins has a utility method to extract the number of
> video channels and depth from caps (see code below).
>
> Problem is that it fails for sparse formats (BGRx, ...) where it
> reports 3 channels of depth 8.
> For opencv to work correctly downstream, it should report 4 channels.
>
> I can't find a simple way to detect that the caps/video info is
> sparse and has one additional "channel".
Should it actually use that additional "channel", it's containing
arbitrary and useless data.
In any case, you can get this info with e.g.
GST_VIDEO_INFO_COMP_PSTRIDE(), which will tell you 4 here (4 bytes to
get from one pixel to the next). It might even be better to directly
have a switch around the GstVideoFormat here instead.
--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161024/8b803012/attachment.sig>
More information about the gstreamer-devel
mailing list