ISOBMFF
C++ Library for ISO/IEC 14496-12 - ISO Base Media File Format (QuickTime, MPEG-4, HEIF, etc)
Install / Use
/learn @DigiDNA/ISOBMFFREADME
ISOBMFF
C++ Library for ISO/IEC 14496-12 - ISO Base Media File Format (QuickTime, MPEG-4, HEIF, etc)
About
ISOBMFF is a cross-platform C++ library for reading/parsing files in the ISO Base Media File Format (ISO/IEC 14496-12).
The ISO Base Media File Format is a container format, used by many file types, including:
- QuickTime (
.mov) - MPEG-4 (
.m4v,.m4a, etc) - 3GP (
.3g2) - HEIF/HEIC (
.heif,.heic, etc) - ... and many others
Support for editing/writing files is not available at the moment, but the library has been designed for this goal in mind, so writing support will eventually become available.
ISO Base Media File Format
ISO base media file format (ISO/IEC 14496-12 - MPEG-4 Part 12) defines a general structure for time-based multimedia files such as video and audio.
It is designed as a flexible, extensible format that facilitates interchange, management, editing and presentation of the media.
The presentation may be local, or via a network or other stream delivery mechanism.
The file format is designed to be independent of any particular network protocol while enabling support for them in general.
It is used as the basis for other media file formats (e.g. container formats MP4 and 3GP).
Source: Wikipedia
Building
Fetch the submodules
After you have cloned the ISOBMFF project, you will need to fetch the submodules that are defined in the .gitmodules file.
git submodule update --init --recursive
macOS
An Xcode project is provided for convenience, containing the following targets:
ISOBMFF: The main cross-platform C++ library.ISOBMFF-Dump: A cross-platform command-line utility for dumping files.
Note that you can also build the library with make, on the command line.
Windows
An VisualStudio solution is provided for convenience, containing the following targets:
ISOBMFF Static v142: A static library built with the V142 toolset (VS 2019)ISOBMFF Static v143: A static library built with the V143 toolset (VS 2022)ISOBMFF DLL v142: A dynamic library (DLL) built with the V142 toolset (VS 2019)ISOBMFF DLL v143: A dynamic library (DLL) built with the V143 toolset (VS 2022)ISOBMFF-Dump: A cross-platform command-line utility for dumping files.
Linux/Unix
The library can be build with make, on the command line.
Library Usage
Parsing is done with the ISOBMFF::Parser class:
ISOBMFF::Parser parser;
try
{
parser.Parse( "path/to/some/file" );
}
catch( ... )
{}
When the parser is done, an instance of ISOBMFF::File can be retrieved:
std::shared_ptr< ISOBMFF::File > file = parser.GetFile();
Boxes can then be retrieved the following way, from the file:
std::shared_ptr< ISOBMFF::Box > box = file->GetBox( "ftyp" );
If the box does not exist, it will return nullptr.
A typed box can be retrieved the following way:
std::shared_ptr< ISOBMFF::FTYP > ftyp = file->GetTypedBox< ISOBMFF::FTYP >( "ftyp" );
Here, nullptr will be returned if the box does not exist, or is not of the correct type.
Container boxes acts just the same:
std::shared_ptr< ISOBMFF::ContainerBox > moov = file->GetTypedBox< ISOBMFF::ContainerBox >( "moov" );
std::shared_ptr< ISOBMFF::MVHD > mvhd = moov->GetTypedBox< ISOBMFF::MVHD >( "mvhd" );
The parser also supports custom boxes:
parser.RegisterBox( "abcd", [ = ]() -> std::shared_ptr< CustomBox > { return std::make_shared< CustomBox >(); } );
It will then create an instance of CustomBox when encountering an abcd box somewhere in the file.
The custom class needs at least to inherit from Box:
class CustomBox: public ISOBMFF::Box
{
public:
CustomBox(): Box( "abcd" )
{}
void CustomBox::ReadData( Parser & parser, BinaryStream & stream )
{
/* Read box data here... */
}
std::vector< std::pair< std::string, std::string > > CustomBox::GetDisplayableProperties() const
{
/* Returns box properties, to support output... */
return {};
}
};
License
ISOBMFF is released under the terms of the MIT License.
Repository Infos
Owner: DigiDNA
Web: www.digidna.net
Blog: imazing.com/blog
Twitter: @DigiDNA
GitHub: github.com/DigiDNA
Related Skills
healthcheck
344.1kHost security hardening and risk-tolerance configuration for OpenClaw deployments
imsg
344.1kiMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
xurl
344.1kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
qqbot-channel
344.1kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
