Incorrect DAR with anamorphic videos on 2.7

Started by andi0661, January 20, 2020, 04:39:23 PM

Previous topic - Next topic

andi0661

I was using Avidemix 2.5 so far and have recently migrated to use 2.7, and have a problem with the DAR with anamorphic videos.

My input file is an AVI container with an AVC video stream that looks correct when displayed with a 16:9 display aspect ratio. MediaInfo shows these fields for the input file:

  • Width: 720 pixels
  • Height: 576 pixels
  • Display aspect ratio: 16:9

Using Avidemux  2.7, with its Pixel Aspect Ratio set to 64:45 ("vui.sar_height=45", "vui.sar_width=64" in the project file) creates these fields in the output file:

  • Width: 720 pixels
  • Height: 576 pixels
  • Display aspect ratio: 5:4
  • Original display aspect ratio: 16:9
This causes VLC as well as Plex to show the video by default using the 5:4 aspect ratio, which is of course incorrect.

Avidemux 2.5 in this same situation created these fields in the output file:

  • Width: 720 pixels
  • Height: 576 pixels
  • Display aspect ratio: 16:9
which of course leaves no doubt what the intended DAR should be because there is only one field for it.

I recall that this had been discussed before, but could not find the post for it anymore.

My questions are:

  • Is this behavior of Avidemux 2.7 intended or a bug?
  • Does Avidemux 2.6 also behave like 2.7 in this regard?
  • Which of the two DAR fields is a player supposed to use if they are both set and have different values?

eumagga0x2a

Quote from: andi0661 on January 20, 2020, 04:39:23 PM
I was using Avidemix 2.5 so far and have recently migrated to use 2.7, and have a problem with the DAR with anamorphic videos.

My input file is an AVI container with an AVC video stream that looks correct when displayed with a 16:9 display aspect ratio. MediaInfo shows these fields for the input file:

  • Width: 720 pixels
  • Height: 576 pixels
  • Display aspect ratio: 16:9

Using Avidemux  2.7

Please keep in mind that only the latest nightly and the last release are supported, the last release in sense that all issues found there should be verified with the latest nightly anyway, so we are back to the latest nightly.

Quotewith its Pixel Aspect Ratio set to 64:45 ("vui.sar_height=45", "vui.sar_width=64" in the project file) creates these fields in the output file:

  • Width: 720 pixels
  • Height: 576 pixels
  • Display aspect ratio: 5:4
  • Original display aspect ratio: 16:9
This causes VLC as well as Plex to show the video by default using the 5:4 aspect ratio, which is of course incorrect.

Which muxer do you use? For MP4 and MKV, you should force display aspect ratio in the configuration of the respective muxer. No other muxers support this. The value from codec, in case of H.264 from SPS ("Original display aspect ratio") is ignored by many video players.

QuoteIs this behavior of Avidemux 2.7 intended or a bug?

Unsure. On one hand, not applying any pixel aspect ratio transformations (always assuming square pixel) during preview is by design. On the other, not conveying pixel aspect ratio via FilterInfo (which would need to be extended) further down to encoders and ultimately muxers might be an omission worth a correction.

QuoteDoes Avidemux 2.6 also behave like 2.7 in this regard?

Yes, except of that it was not possible back then to force display aspect ratio in the MP4 muxer.


QuoteWhich of the two DAR fields is a player supposed to use if they are both set and have different values?

IMHO in ideal world, if the container doesn't have any aspect ratio info, the value from video codec should be evaluated and respected. Otherwise container should prevail. GStreamer is the only framework I'm aware of (it doesn't mean much, however) which evaluates the info from the video codec. Many in not most of other video players ignore that and do what the container says. If the latter doesn't specify pixel aspect, square pixels are assumed.

andi0661

Thanks for the quick response!

* Which muxer do I use? The output container format is MP4.

* On forcing the display aspect ratio in the configuration of the respective muxer: I was not aware that this is a setting on the MP4 muxer. I am now using that setting ("Force Aspect Ratio" enabled in the MP4 muxer configuration) and will post whether it works (not that I have any doubts - just to double confirm).

andi0661

I can confirm that enabling the "Force Aspect Ratio" checkbox in the config of the MP4 muxer causes Avidemux 2.7 to produce these fields in the output file (according to MediaInfo):


  • Width: 720 pixels
  • Height: 576 pixels
  • Display aspect ratio: 16:9

The "Original display aspect ratio" field that was generated when that checkbox was not enabled is no longer produced.

So my problem is completely addressed. Thanks again!