alfg / mp4-rust

MP4 reader + writer library in Rust! 🎥🦀
https://crates.io/crates/mp4
MIT License
296 stars 81 forks source link

mp4a: Support QT sound sample description version 1. #112

Open w-flo opened 1 year ago

w-flo commented 1 year ago

If the QT version in a sound sample description is set to 1, there are 4 additional 32-bit integers in the description record according to QT docs.

At least some recently sold iPhones produce sound sample description records like this, so this change fixes a parsing failure for these files.


Not sure if it would be better to actually parse the 4 ints and store them in a struct (using a name like QtVersion1Data or SizeInfo or something like that), that could be added as an Option<> to the Mp4aBox? I really don't care about the audio description though, and it's not an ISO mp4 file, so maybe this crate is less interested in these kinds of files. Although it parses without throwing an error otherwise. I just need the width/height of the video in that mov file, and that works great with this patch, but I'm fine with whatever you prefer.

w-flo commented 1 year ago

I believe #96 already implemented this! I didn't notice that PR before creating this one. Thank you @emkman99.

I will test it when a new release hits crates.io, and hopefully close this PR.