Writing an MP4 Muxer for Fun and Profit
The latest OBS update introduces a new "Hybrid MP4" output format to improve data loss and compatibility issues. It combines fragmented and regular MP4 files, offering enhanced features and collaboration with FFmpeg.
Read original articleIn the latest update of OBS, a new "Hybrid MP4" output format was introduced to address issues with data loss and compatibility. The post explains the structure of MP4 files, the challenges with traditional MP4 formats, and the attempt to solve them with a hybrid approach. The fragmented MP4 format was explored but had drawbacks like limited support and slow access. The solution, Hybrid MP4, combines the resilience of fragmented files with the simplicity of regular MP4s. This approach involves finalizing a fragmented file with a full moov to appear as a normal MP4, offering the best of both worlds. The implementation also includes features like chapter markers, additional metadata, support for multiple video and audio tracks, and addressing audio sync issues. The post details the journey of developing this feature, including collaboration with FFmpeg for a similar implementation. The Hybrid MP4 feature is now available in OBS, with potential future enhancements for users.
Related
LosslessCut: The Swiss army knife of lossless video/audio editing
LosslessCut is a versatile FFmpeg GUI tool for fast, lossless media operations. It supports cutting, merging, editing, and more on various formats. Available on multiple platforms with advanced features and automation options.
How Video Works
The site explains video playback intricacies, including subtitles, adaptive streaming, HLS, DASH technologies, and player selection for optimal streaming experience. Fast delivery and adaptive bitrate enhance viewing quality.
We increased our rendering speeds by 70x using the WebCodecs API
Revideo, a TypeScript framework, boosted rendering speeds by 70 times with WebCodecs API. Challenges overcome by browser-based video encoding. Limited audio processing and browser compatibility remain.
How HLS Works
The blog post explores implementing HTTP Live Streaming (HLS) on Bluesky for adaptive-bitrate video streaming. It covers HLS structure, playlist files, tracking, closed captions, and video quality adjustments for efficient streaming.
YouTube Embeds Are Bananas Heavy and It's Fixable
YouTube embeds are criticized for their heavy size, impacting website performance. Web Components offer a lighter alternative, like lite-youtube-embed, maintaining functionality while reducing size to 100k. This shift enhances efficiency and user experience.
- Users appreciate the innovation and express interest in seeing support for Hybrid MP4 in popular tools like mp4-muxer and mp4box.
- Some users share their experiences with MP4 demuxing issues and recommend tools like mp4box for debugging.
- There are technical questions about how existing media players will handle the new format without modifications.
- Comments highlight the challenges and frustrations of working with MP4 formats, including the complexity of implementation and the pain of debugging.
- Some users point out that certain features, like multiple video tracks, are not new but have been available in MP4 for a long time.
Thinking back on it now, I just did a little trial and error until I found something that worked, but what would I search for if I was trying to find data on how... ?streamable? an encoding is?
If curious, I got my proof of concept working but it was unpleasantly slow. I blindly chunked the incoming stream into megabyte sized chunks registered the chunks on ipfs then used ipfs pubsub to announce the chunk to any watchers. The watcher would watch the pubsub channel for announcements download the chunk and try to reassemble it in order and play it. one neat side effect that I found was when the stream was done if I had stored all the ipfs address I could then generate a whole ipfs file structure you could use to download the stream at a later date.
Having recently written my own fragmented-MP4 remuxing library, I felt this pain too, and my soon-to-be-published writeup has very similar things to say about the ISO's paywalling practices.
I think one of the hardest parts of ISO-BMFF, aside from spec availability, is that it's pretty hard to implement "cleanly", making existing code confusing to use as reference. (My own implementation is certainly not clean either)
I always forget about GStreamer but I think I have a perfect application for it. Hopefully it’s easier to use as a library than MediaFoundation or FFMpeg.
Would love to see MP4 Hybrid supported in popular packages like mp4-muxer [1] and mp4box [2] someday.
1: https://github.com/Vanilagy/mp4-muxer 2: https://github.com/gpac/mp4box.js
Very cute easter egg. Moof is what dogcows say: http://clarus.chez-alice.fr/history.php
> 2. They are slow to access on HDD or network drives, as each fragment's header needs to be read to get the complete metadata of the file and start playback
Huh? That's not right. The whole point of fragmented MP4 is that you can access any fragment without having to read the headers of the other fragments. That's why adaptive streaming is built around fragmented MP4.
I have 20 years or professional experience and my conclusion, if someone asked, what IT boils down to: pain.
The pain is what filters who can succeed and who fail. Can you endure hunting a bug for 7 hours in your chair? Can you fix problem after problem to get a system running? Everything that can fail, will fail, and you have to deal with it.
MP4 has been able to have multiple video streams for quite some time. One of the very first advanced MP4 authoring tools I saw in the early 00s allowed for this, and we used it to make a few advanced files to demo the "new" MP4 format. Much like multi-angle DVDs, this was a niche feature that did not gain very much attraction. I could see why someone not around at that time might think this is a new feature, but it's not
Related
LosslessCut: The Swiss army knife of lossless video/audio editing
LosslessCut is a versatile FFmpeg GUI tool for fast, lossless media operations. It supports cutting, merging, editing, and more on various formats. Available on multiple platforms with advanced features and automation options.
How Video Works
The site explains video playback intricacies, including subtitles, adaptive streaming, HLS, DASH technologies, and player selection for optimal streaming experience. Fast delivery and adaptive bitrate enhance viewing quality.
We increased our rendering speeds by 70x using the WebCodecs API
Revideo, a TypeScript framework, boosted rendering speeds by 70 times with WebCodecs API. Challenges overcome by browser-based video encoding. Limited audio processing and browser compatibility remain.
How HLS Works
The blog post explores implementing HTTP Live Streaming (HLS) on Bluesky for adaptive-bitrate video streaming. It covers HLS structure, playlist files, tracking, closed captions, and video quality adjustments for efficient streaming.
YouTube Embeds Are Bananas Heavy and It's Fixable
YouTube embeds are criticized for their heavy size, impacting website performance. Web Components offer a lighter alternative, like lite-youtube-embed, maintaining functionality while reducing size to 100k. This shift enhances efficiency and user experience.