Stonks3141 / pet-monitor-app

A simple pet monitor for Linux.
MIT License
12 stars 1 forks source link

Adding TFHD flag for DEFAULT_BASE_IS_MOOF needed for MSE #119

Closed Type1J closed 10 months ago

Type1J commented 10 months ago

Hello, I've been working on a video project, and your library has helped me immensely! Thanks for making it!

Part of my project is serving segments for use with DASH.js, which uses the browser's video tags' Media Source Extensions (MSE) to stream segments. I encode the same video multiple times at different bitrates as well.

I found that I could play complete files (init segment + 1 or more media segments) with vlc from the same encoded set, but I couldn't reorder media segments, or use higher or lower bitrate versions of the same media segment due to the base data offset being different for variants of the same media segment. However, I found that MSE actually requires a flag to be set that overrides the base data offset to be the start of the moof, which is what mp4-stream sets it to anyway. (See https://w3c.github.io/mse-byte-stream-format-isobmff/ where it talks about default-base-is-moof).

I added this flag into the bmff library, and things started working between different encoded sets! I believe that this should be useful to anyone using the bmff library for DASH or MSE streaming, so I made this pull request.

I only changed mp4-stream to set this flag to false, so that it doesn't change the current way that the mp4-stream library or the pet-monitor-app binary functions.

Stonks3141 commented 10 months ago

Thanks!

Type1J commented 10 months ago

It looks like a check didn't pass because the other crates are using released versions. In multi-crate repos it's pretty common to specify paths for the dependencies that are in the same repo. I think that using paths for bmff and mp4-stream would allow the tests to run against the latest versions of the crate instead of the last released versions.

Stonks3141 commented 10 months ago

That would probably be better, I'm hoping to revisit this project at some point and finish some things so I'll keep it in mind.