Subject: [Cellar] How to Document an Unknown DAR

From: Dave Rice <[email-masked]>
Date: Thu, 21 Jul 2016 23:38:30 +0100

Hi all,

Kieran O'Leary pointed this behavior out to me and I believe this is an issue with the documentation on aspect ratios. Many file formats have an method to express an unknown SAR. In ffmpeg this is reported as a SAR of 0:1. A sample may be made with `ffmpeg -f lavfi -i testsrc -t -1 -c:v v210 no_sar.mov`.

When muxig the streams into Matroska, to be lossless, the resulting Matroska file should also express that the SAR is unknown. However with `ffmpeg -i no_sar.mov -c copy is_there_sar.mkv`, the output file sets the PixelWidth and PixelHeight correctly, and does not store the DisplayWidth or DisplayHeight. The problem is that the DisplayWidth and DisplayHeight default to equations based upon PixelWidth and PixelHeight. Thus the resulting file as a DisplayWidth equal to PixelWidth and DisplayHeight equal to PixelHeight. Thus Matroska is not capable of communicating any difference between a 1/1 SAR and an unknown (0/1) SAR. The source file expresses an uncertainty but in the resulting file the same concept is now a certainty.

Dave Rice

---

From: Kieran O Leary <[email-masked]>
Date: Sun, 24 Jul 2016 03:24:55 +0200

Hi,

> Kieran O'Leary pointed this behavior out to me and I believe this is an issue with the documentation on aspect ratios. Many file formats have an method to express an unknown SAR. In ffmpeg this is…

Just for reference, here's the ffmpeg-user thread on the subject that
was answered by Carl Eugen Hoyos.
http://ffmpeg.org/pipermail/ffmpeg-user/2016-July/032774.html
The conclusion was that FFmpeg isn't doing anything wrong as it is
just adhering to the current Matroska spec.

-Kieran.

---

From: Steve Lhomme <[email-masked]>
Date: Mon, 25 Jul 2016 18:01:17 +0200

Maybe DisplayWidth and/or DisplayHeight should be allowed to be 0
then. Combined with a DisplayUnit of 3 (display aspect ratio) that
should be sufficient.

The problem is that such files would be considered invalid by current
tools and players.

What is a player supposed to do with a file that sets an unknown SAR?
I suppose that means for SAR *and* DAR set ? Because if the DAR is
known there's no problem. If that always means using the pixels as 1:1
then we can use that as well. Or does it mean playback can be random,
as fit by the player ?

2016-07-22 0:38 GMT+02:00 Dave Rice <[email-masked]>:
> _______________________________________________
> Cellar mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cellar

-- 
Steve Lhomme
Matroska association Chairman

---

From: Dave Rice <[email-masked]>
Date: Mon, 25 Jul 2016 13:34:38 -0400

Hi,

> On Jul 25, 2016, at 12:01 PM, Steve Lhomme <[email-masked]> wrote:
> 

Another option could be to add a new DisplayUnit value to declare that the display size is unknown.

> The problem is that such files would be considered invalid by current

Right.

> then we can use that as well. Or does it mean playback can be random,

I think the player would (should) react the same whether the SAR = 1/1 or DAR is unknown. But for the user they may know they need to resize is the value is unknown, but that it is not needed if SAR = 1/1.
Dave

---

From: Steve Lhomme <[email-masked]>
Date: Mon, 25 Jul 2016 22:57:55 +0200

> Another option could be to add a new DisplayUnit value to declare that
the display size is unknown.

Yes that sounds better. It would be a unit meaning "discard the display
value". It's odd but it's backward compatible. Even more so than players
that encounter this new value will not know what to do with it. Which is
perfect.

> I think the player would (should) react the same whether the SAR = 1/1 or
DAR is unknown. But for the user they may know they need to resize is the
value is unknown, but that it is not needed if SAR = 1/1.
> >> Kieran O'Leary pointed this behavior out to me and I believe this is
an issue with the documentation on aspect ratios. Many file formats have an
method to express an unknown SAR. In ffmpeg this is reported as a SAR of
0:1. A sample may be made with `ffmpeg -f lavfi -i testsrc -t -1 -c:v v210
no_sar.mov`.
> >>
> >> When muxig the streams into Matroska, to be lossless, the resulting
Matroska file should also express that the SAR is unknown. However with
`ffmpeg -i no_sar.mov -c copy is_there_sar.mkv`, the output file sets the
PixelWidth and PixelHeight correctly, and does not store the DisplayWidth
or DisplayHeight. The problem is that the DisplayWidth and DisplayHeight
default to equations based upon PixelWidth and PixelHeight. Thus the
resulting file as a DisplayWidth equal to PixelWidth and DisplayHeight
equal to PixelHeight. Thus Matroska is not capable of communicating any
difference between a 1/1 SAR and an unknown (0/1) SAR. The source file
expresses an uncertainty but in the resulting file the same concept is now
a certainty.