Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding TFHD flag for DEFAULT_BASE_IS_MOOF needed for MSE #119

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

Type1J
Copy link
Contributor

@Type1J Type1J commented Oct 30, 2023

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
Copy link
Owner

Thanks!

@Stonks3141 Stonks3141 merged commit 07aa90e into Stonks3141:main Nov 1, 2023
1 of 4 checks passed
@Type1J
Copy link
Contributor Author

Type1J commented Nov 2, 2023

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants