[FFmpeg-user] Prores 444 being detected by quicktime as 422?
Carl Eugen Hoyos
cehoyos at ag.or.at
Wed Sep 12 10:33:32 CEST 2012
On Tuesday 11 September 2012 10:04:07 am Robert Krüger wrote:
> > It does not set the correct fourcc. It should be ap4h but it is apcn
> > (which is the fourcc for prores 422). Quicktime and other apple
> > software (like Final Cut) more or less blindly trust the fourcc. I
> > tried overriding it with -vtag but that didn't work either:
>
> looking at the code, it looks as if Prores 4444 is not modeled as a
> profile at all (see variable prores_profile_info), so it never sets
> the correct fourcc.
Thank you for analyzing this - I simply didn't understand the problem;-)
(I couldn't believe it was not reported before and not tested originally.)
Could you test attached patch? It contains some guessing.
Thank you, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index 53c74a4..a9ab541 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -43,6 +43,7 @@ enum {
PRORES_PROFILE_LT,
PRORES_PROFILE_STANDARD,
PRORES_PROFILE_HQ,
+ PRORES_PROFILE_4444,
};
enum {
@@ -121,7 +122,7 @@ static const struct prores_profile {
int max_quant;
int br_tab[NUM_MB_LIMITS];
int quant;
-} prores_profile_info[4] = {
+} prores_profile_info[5] = {
{
.full_name = "proxy",
.tag = MKTAG('a', 'p', 'c', 'o'),
@@ -153,8 +154,15 @@ static const struct prores_profile {
.max_quant = 6,
.br_tab = { 1566, 1216, 1070, 950 },
.quant = QUANT_MAT_HQ,
- }
-// for 4444 profile bitrate numbers are { 2350, 1828, 1600, 1425 }
+ },
+ {
+ .full_name = "4444",
+ .tag = MKTAG('a', 'p', '4', 'h'),
+ .min_quant = 1,
+ .max_quant = 6,
+ .br_tab = { 2350, 1828, 1600, 1425 },
+ .quant = QUANT_MAT_DEFAULT,
+ },
};
#define TRELLIS_WIDTH 16
@@ -890,6 +898,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
+ if (avctx->pix_fmt == PIX_FMT_YUV444P10)
+ ctx->profile = PRORES_PROFILE_4444;
+
ff_proresdsp_init(&ctx->dsp, avctx);
ff_init_scantable(ctx->dsp.dct_permutation, &ctx->scantable,
interlaced ? ff_prores_interlaced_scan
@@ -1022,7 +1033,7 @@ static const AVOption options[] = {
AV_OPT_TYPE_INT, { .i64 = 8 }, 1, MAX_MBS_PER_SLICE, VE },
{ "profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT,
{ .i64 = PRORES_PROFILE_STANDARD },
- PRORES_PROFILE_PROXY, PRORES_PROFILE_HQ, VE, "profile" },
+ PRORES_PROFILE_PROXY, PRORES_PROFILE_4444, VE, "profile" },
{ "proxy", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_PROXY },
0, 0, VE, "profile" },
{ "lt", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_LT },
@@ -1031,6 +1042,8 @@ static const AVOption options[] = {
0, 0, VE, "profile" },
{ "hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_HQ },
0, 0, VE, "profile" },
+ { "4444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PRORES_PROFILE_4444 },
+ 0, 0, VE, "profile" },
{ "vendor", "vendor ID", OFFSET(vendor),
AV_OPT_TYPE_STRING, { .str = "Lavc" }, CHAR_MIN, CHAR_MAX, VE },
{ "bits_per_mb", "desired bits per macroblock", OFFSET(bits_per_mb),
More information about the ffmpeg-user
mailing list