# Writing an MP4 Muxer for Fun and Profit - Hybrid MP4 Solution > [! note]- > The content of this page is generated by audio/video transcription and text transformation from the content and links of this source. Source: [https://fosdem.org/2025/schedule/event/fosdem-2025-6795-writing-an-mp4-muxer-for-fun-and-profit/](https://fosdem.org/2025/schedule/event/fosdem-2025-6795-writing-an-mp4-muxer-for-fun-and-profit/) <video src="https://video.fosdem.org/2025/k3401/fosdem-2025-6795-writing-an-mp4-muxer-for-fun-and-profit.av1.webm" controls></video> ## Summary & Highlights: This session at FOSDEM 2025, led by Dennis Sädtler, focuses on developing a new MP4 muxer to address the limitations of traditional MP4 files, particularly in the context of OBS Studio. The session explores the creation of 'Hybrid MP4', a solution that combines the benefits of fragmented MP4 while maintaining compatibility with standard MP4 players. **Introduction to MP4 and OBS** MP4 is a widely used media container format, but it poses challenges for data safety. OBS Studio, a popular open-source live streaming and recording software, requires reliable file formats to prevent data loss, especially given its diverse user base. **Challenges with Traditional MP4** The session highlights the shortcomings of MP4, particularly its vulnerability to data loss if a file is not properly closed. This has led OBS to previously use formats like MKV, which have their own limitations. **Developing Hybrid MP4** Dennis introduces Hybrid MP4, a creative solution leveraging the ISO-BMFF specification. This approach allows for a more resilient file format that can handle interruptions without losing data, enhancing user experience. **Collaboration and Future Prospects** The session also discusses collaboration with FFmpeg and potential future developments, including support for other formats and features. This innovation could significantly impact media handling in open-source projects. ## Importance for an eco-social transformation The development of Hybrid MP4 is significant for eco-social transformation as it enhances the reliability and accessibility of media files, crucial for educational and community projects. It offers a sustainable approach to media handling by reducing data loss and improving user experience. Eco-social designers can leverage this technology in various applications, from educational content creation to community media projects. However, challenges include the need for broader software support and overcoming proprietary format limitations. The open-source nature of this development encourages collaboration and innovation, aligning with ethical and sustainable practices. ## Slides: | | | | --- | --- | | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_001.jpg\|300]] | The introductory slide humorously suggests that writing an MP4 muxer involves more pain than profit. Dennis Sädtler presents this session at FOSDEM 2025. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_002.jpg\|300]] | Dennis Sädtler is introduced as a software developer from Germany, currently working on media projects at Twitch and contributing to OBS Studio and other open-source projects. He has expertise in MP4 technology. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_003.jpg\|300]] | MP4 is described as a widely used media container format, originating from Apple's QuickTime File Format in the 90s and later adapted by ISO into MP4, then generalized into ISO-BMFF. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_004.jpg\|300]] | OBS Studio is presented as a free and open-source software for live streaming and recording, with a large and varied user base. It emphasizes the importance of avoiding data loss due to its widespread use without backup recording. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_005.jpg\|300]] | The slide outlines a conundrum: while MP4 is needed for user-friendly files, its structure can lead to data loss, making it unsuitable for reliable recording. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_006.jpg\|300]] | Plain MP4 is problematic due to its structure, which can lead to data loss if the file is not properly finalized, posing a risk for users. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_007.jpg\|300]] | The slide reiterates the problems with plain MP4, emphasizing the risk of data loss. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_008.jpg\|300]] | Before 2019, OBS used FLV due to its compatibility with live streaming. Since 2019, MKV has been used, but it also has limitations, leading to the exploration of other formats. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_009.jpg\|300]] | The problem is summarized as the need for a file format that balances user-friendliness and data safety, which MP4 currently fails to provide. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_010.jpg\|300]] | Fragmented MP4 is considered as a potential solution, offering resilience against data loss by allowing partial file recovery. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_011.jpg\|300]] | Despite its potential, Fragmented MP4 is not widely supported, leading to poor user experiences on various platforms. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_012.jpg\|300]] | Fragmented MP4 faces compatibility issues with some software and platforms, resulting in a subpar user experience due to slow access and lack of embed support. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_013.jpg\|300]] | The slide introduces the idea of combining fragmented MP4 with standard MP4 to create a more versatile and resilient format. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_014.jpg\|300]] | It explores the possibility of creatively using ISO/IEC specifications to enhance MP4 functionality. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_015.jpg\|300]] | Further discussion on leveraging ISO/IEC standards to improve MP4 resilience and user experience. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_016.jpg\|300]] | The slide transitions to introducing the new Hybrid MP4 concept. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_017.jpg\|300]] | Hybrid MP4 is introduced as a solution that combines the benefits of fragmented and standard MP4, enhancing data safety and compatibility. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_018.jpg\|300]] | The decision to develop a new muxer rather than relying on FFmpeg is explained, highlighting the benefits of native development for control and experimentation. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_019.jpg\|300]] | The development process is outlined, emphasizing simplicity and adherence to relevant specifications, with new features added to OBS. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_020.jpg\|300]] | The muxer development process is summarized, noting the extensive code and testing involved, resulting in a stable implementation. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_021.jpg\|300]] | FFmpeg's adoption of a similar feature shortly after OBS's implementation is noted, highlighting collaboration and shared goals. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_022.jpg\|300]] | Future possibilities for Hybrid MP4 are discussed, including server-side concatenation and enhanced streaming capabilities. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_023.jpg\|300]] | Upcoming developments include support for Hybrid MOV, ProRes, and additional features in OBS, expanding its capabilities. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_024.jpg\|300]] | Lessons learned from the project are shared, emphasizing the complexities of audio and video processing, and the simplicity of MP4 despite its challenges. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_025.jpg\|300]] | Acknowledgements are given to contributors and resources that aided the project, with criticism of ISO for paywalling important specifications. | ![[FOSDEM 2025/assets/Writing-an-MP4-Muxer-for-Fun-and-Profit/preview_026.jpg\|300]] | The session concludes with an invitation for feedback and questions, providing contact information for further discussion. ## Links [Slides](https://fosdem.org/2025/events/attachments/fosdem-2025-6795-writing-an-mp4-muxer-for-fun-and-profit/slides/238393/MP4_Pain_2VofEUJ.pdf) [Video recording (AV1/WebM)](https://video.fosdem.org/2025/k3401/fosdem-2025-6795-writing-an-mp4-muxer-for-fun-and-profit.av1.webm) [Video recording (MP4)](https://video.fosdem.org/2025/k3401/fosdem-2025-6795-writing-an-mp4-muxer-for-fun-and-profit.av1.mp4) [Video recording subtitle file (VTT)](https://fosdem.org/2025/events/attachments/fosdem-2025-6795-writing-an-mp4-muxer-for-fun-and-profit/subtitles/238393/MP4_Pain_2VofEUJ.vtt)