Subject: Re: [Cellar] Film: color handling - container or codec?

From: wm4 <[email-masked]>
Date: Thu, 2 Feb 2017 10:03:19 +0100

On Thu, 15 Dec 2016 10:16:57 +0100
"Peter B." <[email-masked]> wrote:

> =======================
> container or codec - or both?
> =======================
> 
> 
> All 3 versions have their pros and cons, but I think having it in both
> causes more trouble than does good (see below).

Using the codec has another advantage: parameters can change at runtime.

I have seen Matroska files which have both codec and container aspect
ratio set, and for which the codec aspect ratio changed at runtime.
There are barely two pieces of software which handle this the same way.

On the other hand, no matter what you do, getting multiple
implementations to handle codec/container mismatch the same way has a
high chance of failure, because they could support the codec and
container hints to a different degree.

I think ideally, container hints should either not be defined, or if
they are, reflect the codec hints exactly. If Matroska can contain
midstream parameter changes, this would require Matroska to have a
mechanism for reflecting them in the container metadata.

---

From: Steve Lhomme <[email-masked]>
Date: Sat, 4 Feb 2017 15:15:51 +0100

Sorry being late on this. This is a more general issue than just the
colours, it's also true for cropping. The classic case is 1080p MPEG-2
files which actually report 1088 height (IIRC) and so cropping is
forced in the container.

In general we need to tell in the Matroska very clearly how it works
between the codec and the container. IMO the sensitive way to do it is
leave it to the codec when it knows, and put it in the container when
the codec doesn't have the information. When it is found in the
container AND in the codec, it should mean that the container decided
to override whatever the codec says. For example if the codec put the
wrong information, it's possible to fix it "losslessly" in the
container (in the sense you don't have to edit each frame and reencode
them). Or maybe change values to make things look better (or worse).

There should not be a scenario where you get the information twice and
pick whichever you want. I know playback frameworks are not exactly
designed that way right now (FFmpeg/libav/VLC) but IMO that's the
clean way to handle it.

2017-02-02 10:03 GMT+01:00 wm4 <[email-masked]>:
> _______________________________________________
> Cellar mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cellar

-- 
Steve Lhomme
Matroska association Chairman