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 732870 - jpegenc: add support for encoding from nv21
jpegenc: add support for encoding from nv21
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2014-07-07 22:40 UTC by Nicola
Modified: 2014-07-23 06:37 UTC
See Also:
GNOME target: ---
GNOME version: ---

allow encoding from nv21 (802 bytes, patch)
2014-07-07 22:40 UTC, Nicola
reviewed Details | Review
nv12 seems ok (875 bytes, patch)
2014-07-08 00:29 UTC, Nicola
committed Details | Review

Description Nicola 2014-07-07 22:40:51 UTC
Created attachment 280092 [details] [review]
allow encoding from nv21

encoding from nv21 seems to work fine, tested with the following pipeline:

gst-launch-1.0 v4l2src ! videoconvert ! video/x-raw,format=NV21 ! jpegenc ! matroskamux ! filesink location=/tmp/test.mkv

actually jpeg encoding is restrincted to some yuv and rgb formats, as they are obtained? Probably other formats work too
Comment 1 Nicolas Dufresne (ndufresne) 2014-07-08 00:12:30 UTC
Review of attachment 280092 [details] [review]:

Great that's it ? Can we add NV12 too ?
Comment 2 Nicolas Dufresne (ndufresne) 2014-07-08 00:19:26 UTC
Review of attachment 280092 [details] [review]:

Hmm, can't find any semi-color format in J_COLOR_SPACE, are you sure this is tested ? I would have expected a mapping ...
Comment 3 Nicolas Dufresne (ndufresne) 2014-07-08 00:26:33 UTC
Ok, tested it myself and it works indeed, need to dig yup to find some doc, and if (or when) that was added.
Comment 4 Nicola 2014-07-08 00:29:04 UTC
Created attachment 280096 [details] [review]
nv12 seems ok

tested with the same pipeline as above changing NV21 with NV12
Comment 5 Nicolas Dufresne (ndufresne) 2014-07-08 01:09:28 UTC
Ok, the trick is that _COMP_DATA() and _PSTRIDE() is being used. Basically we
tell, for NV12, the U starts where the UV plane start, and pixel stride 2 (1
byte padding), and V is the UV planes start + 1.
Comment 6 Nicolas Dufresne (ndufresne) 2014-07-08 01:09:59 UTC
Review of attachment 280096 [details] [review]:

Looks good.
Comment 7 Sebastian Dröge (slomo) 2014-07-21 07:37:25 UTC
commit 60648012f395c708ba61e8937e03d75cc23bf6d5
Author: Nicola Murino <>
Date:   Tue Jul 8 02:18:27 2014 +0200

    jpegenc: Add support for encoding from NV21 and NV12
Comment 8 Nicola 2014-07-23 06:37:07 UTC
thanks, can the patch be pushed to 1.4 branch too please?