ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

[H.264] Support non-square Pixel Aspect Ratio in MPEG DASH & Smooth Streaming

Open srikieonline opened this issue 11 years ago • 3 comments

I saw that there was a issue reported here about supporting non-square Pixel aspect ratio for HLS streams.

We have a MPEG-DASH non-square stream (unfortunately cannot be shared due to legal reasons) and it renders incorrectly because the change is obviously applicable to HLS streams only.

Is there a possibility to create a generic H.264 helper class that can parse SPS/PPS data to return the pixelWidthAspectRatio and other necessary information, which can then be used across several formats.

srikieonline avatar Aug 08 '15 00:08 srikieonline

  • Note that we only fail to handle this correctly if the mp4 container doesn't contain a pasp box. If it does, we set the aspect ratio correctly here. So if this is your own media, you might like to add pasp boxes as appropriate.
  • Since pasp boxes are optional, we should do as you suggest and retrieve the information from the sps data (overriding it with the data in the pasp box if one is also present, since the contents of the pasp box is supposed to take priority).
  • This is relatively low on our list of things to do. Feel free to contribute a pull request if you want to speed things along. It would probably be appropriate to consolidate SPS parsing here, and call that from both AtomParsers.java and H264Reader.java.

ojw28 avatar Aug 08 '15 00:08 ojw28

I have a change for this, just because someone else asked about it and it was easy to do. Will push to dev soon.

ojw28 avatar Aug 10 '15 13:08 ojw28

Thank you!

srikieonline avatar Aug 10 '15 17:08 srikieonline