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 771376 - video: Add top-field-first / bottom-field-first information to raw video caps if interlaced-mode=interleaved & proxy colorimetry in compressed caps too
video: Add top-field-first / bottom-field-first information to raw video caps...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 769048
 
 
Reported: 2016-09-13 16:53 UTC by Sebastian Dröge (slomo)
Modified: 2016-11-01 18:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
video-info: Add optional field-order caps field for interlaced-mode=interleaved (7.51 KB, patch)
2016-09-29 11:38 UTC, Sebastian Dröge (slomo)
committed Details | Review
videoencoder: Proxy interlace-mode and field-order fields from the input to the output caps (1.86 KB, patch)
2016-09-29 11:48 UTC, Sebastian Dröge (slomo)
committed Details | Review
videodecoder: Proxy field order to the output caps (1.03 KB, patch)
2016-09-29 11:48 UTC, Sebastian Dröge (slomo)
committed Details | Review
videoencoder: Proxy colorimetry and chroma-site from input to output caps (1.65 KB, patch)
2016-09-29 11:57 UTC, Sebastian Dröge (slomo)
committed Details | Review
avcodecmap: Configure field order in the context if we can (1.50 KB, patch)
2016-09-29 12:51 UTC, Sebastian Dröge (slomo)
committed Details | Review
avviddec: Use interlaced-mode=interleaved and set field-order if possible (5.71 KB, patch)
2016-09-29 12:51 UTC, Sebastian Dröge (slomo)
committed Details | Review
video-color: Mark some function arguments as const (2.35 KB, patch)
2016-09-30 14:59 UTC, Sebastian Dröge (slomo)
committed Details | Review
video-color: Allow converting incomplete colorimetry to a string (5.26 KB, patch)
2016-09-30 14:59 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2016-09-13 16:53:46 UTC
In interleaved-mode=interleaved we require exactly two fields per buffer, and for 99.9% of the cases the field order is known in advance and static for the whole stream. In many muxer cases we need to know the field order for writing the headers (and need to negotiate that via caps as it can't be changed later).

As such we need this in the caps for these cases. I propose to add a field-order field that can take the following values: top-field-first, bottom-field-first and unknown. It is only valid for interlaced-mode=interleaved, and if not present it is assumed to be unknown for backwards compatibility reasons.
Comment 1 Sebastian Dröge (slomo) 2016-09-28 17:13:50 UTC
I would also like to passthrough interleaved-mode and this new field in GstVideoDecoder/Encoder for the compressed caps
Comment 2 Sebastian Dröge (slomo) 2016-09-29 11:38:10 UTC
Created attachment 336504 [details] [review]
video-info: Add optional field-order caps field for interlaced-mode=interleaved

Usually this information is static for the whole stream, and various
container formats store this information inside the headers for the
whole stream.

Having it inside the caps for these cases simplifies code and makes it
possible to express these requirements more explicitly with the caps.
Comment 3 Sebastian Dröge (slomo) 2016-09-29 11:48:54 UTC
Created attachment 336507 [details] [review]
videoencoder: Proxy interlace-mode and field-order fields from the input to the output caps
Comment 4 Sebastian Dröge (slomo) 2016-09-29 11:48:59 UTC
Created attachment 336508 [details] [review]
videodecoder: Proxy field order to the output caps
Comment 5 Sebastian Dröge (slomo) 2016-09-29 11:57:49 UTC
Created attachment 336509 [details] [review]
videoencoder: Proxy colorimetry and chroma-site from input to output caps
Comment 6 Sebastian Dröge (slomo) 2016-09-29 12:51:01 UTC
Created attachment 336514 [details] [review]
avcodecmap: Configure field order in the context if we can
Comment 7 Sebastian Dröge (slomo) 2016-09-29 12:51:06 UTC
Created attachment 336515 [details] [review]
avviddec: Use interlaced-mode=interleaved and set field-order if possible
Comment 8 Sebastian Dröge (slomo) 2016-09-29 15:38:05 UTC
Review of attachment 336514 [details] [review]:

::: ext/libav/gstavcodecmap.c
@@ +2544,3 @@
+          context->field_order = AV_FIELD_TT;
+        } else if (strcmp (s, "bottom-field-first") == 0) {
+          context->field_order = AV_FIELD_TB;

Not sure if this is indeed TT and TB or anything else. Judging from the code in ffmpeg it could be both.
Comment 9 Sebastian Dröge (slomo) 2016-09-30 14:59:47 UTC
Created attachment 336678 [details] [review]
video-color: Mark some function arguments as const
Comment 10 Sebastian Dröge (slomo) 2016-09-30 14:59:53 UTC
Created attachment 336679 [details] [review]
video-color: Allow converting incomplete colorimetry to a string

This is only a good idea for non-raw caps.
Comment 11 Sebastian Dröge (slomo) 2016-11-01 18:40:24 UTC
Attachment 336504 [details] pushed as 7980963 - video-info: Add optional field-order caps field for interlaced-mode=interleaved
Attachment 336507 [details] pushed as 635d1a2 - videoencoder: Proxy interlace-mode and field-order fields from the input to the output caps
Attachment 336508 [details] pushed as e6fd466 - videodecoder: Proxy field order to the output caps
Attachment 336509 [details] pushed as ad06b54 - videoencoder: Proxy colorimetry and chroma-site from input to output caps
Attachment 336679 [details] pushed as 158eae7 - video-color: Allow converting incomplete colorimetry to a string
Comment 12 Sebastian Dröge (slomo) 2016-11-01 18:43:44 UTC
Attachment 336514 [details] pushed as d2e6575 - avcodecmap: Configure field order in the context if we can
Attachment 336515 [details] pushed as 5e61a89 - avviddec: Use interlaced-mode=interleaved and set field-order if possible