GNOME Bugzilla – 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
Last modified: 2016-11-01 18:46:22 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.
I would also like to passthrough interleaved-mode and this new field in GstVideoDecoder/Encoder for the compressed caps
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.
Created attachment 336507 [details] [review] videoencoder: Proxy interlace-mode and field-order fields from the input to the output caps
Created attachment 336508 [details] [review] videodecoder: Proxy field order to the output caps
Created attachment 336509 [details] [review] videoencoder: Proxy colorimetry and chroma-site from input to output caps
Created attachment 336514 [details] [review] avcodecmap: Configure field order in the context if we can
Created attachment 336515 [details] [review] avviddec: Use interlaced-mode=interleaved and set field-order if possible
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.
Created attachment 336678 [details] [review] video-color: Mark some function arguments as const
Created attachment 336679 [details] [review] video-color: Allow converting incomplete colorimetry to a string This is only a good idea for non-raw caps.
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
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