6

When I decode video frames with FFmpeg (avcodec_decode_video2(), sws_scale()), with some videos (e.g., ProRes4444), I get colors pre-multiplied by alpha, and with other videos (e.g., QuickTime PNG), I get colors that aren't pre-multiplied by alpha.

How can I tell whether the colors are pre-multiplied? Alternatively, how can I tell FFmpeg to always provide either pre-multiplied or un-pre-multiplied ("straight alpha") colors?

smokris
  • 11,390
  • 2
  • 37
  • 55

1 Answers1

0

Try looking at AVCodecContext's color-space related properties, like AVColorSpace.

Karim Agha
  • 3,499
  • 3
  • 27
  • 43
  • Thanks. I checked AVCodecContext's `colorspace`, `color_range`, and `color_trc` values, but they're identical in the pre-multiplied and un-pre-multiplied movies I've tested. – smokris Feb 03 '14 at 02:27