1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-10-30 23:18:11 +02:00

prores_raw_parser: set color params based on vendor

Panasonic cameras record ProRes RAW in V-Log/V-Gamut internally.

Atomos is a brand of recorders which can record uncompressed
non-debayered RAW over HDMI.
All known cameras output linear RAW over HDMI, so mark the transfer function
as linear in that case.
This commit is contained in:
Lynne
2025-10-28 11:48:56 +01:00
parent 71c7b9156b
commit bcfb4b2e3e

View File

@@ -61,7 +61,23 @@ static int prores_raw_parse(AVCodecParserContext *s, AVCodecContext *avctx,
}
/* Vendor header (e.g. "peac" for Panasonic or "atm0" for Atmos) */
bytestream2_skip(&gb, 4);
switch (bytestream2_get_be32(&gb)) {
case MKBETAG('p','e','a','c'):
/* Internal recording from a Panasonic camera, V-Log */
avctx->color_primaries = AVCOL_PRI_V_GAMUT;
avctx->color_trc = AVCOL_TRC_V_LOG;
break;
case MKBETAG('a','t','m','0'):
/* External recording from an Atomos recorder. Cameras universally
* record in their own native log curve internally, but linearize it
* when outputting RAW externally */
avctx->color_primaries = AVCOL_PRI_UNSPECIFIED;
avctx->color_trc = AVCOL_TRC_LINEAR;
break;
default:
avctx->color_trc = AVCOL_TRC_UNSPECIFIED;
break;
};
s->width = bytestream2_get_be16(&gb);
s->height = bytestream2_get_be16(&gb);