[H.264] Support non-square Pixel Aspect Ratio in MPEG DASH & Smooth Streaming
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.
- 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.
I have a change for this, just because someone else asked about it and it was easy to do. Will push to dev soon.
Thank you!