MP4(3)
π hey bestie, welcome to MP4(3) π
okay so first things first: this is the man page for the MP4 library, part of the MP4 File Format Library situation, and yes it lives in section 3 of the manual because it's a library, not a command. library girlies rise π«Ά
β¨ DESCRIPTION β¨
so the MP4 library hands you an API to create and modify mp4 files, exactly as defined by ISO-IEC:14496-1:2001 MPEG-4 Systems. and likeβ¦ this file format? it's derived from Apple's QuickTime file format, which has been doing its multimedia-file-format thing across a whole bunch of platforms and applications. it's a very powerful and extensible format that can accommodate practically any type of media. no cap. π
here's the tea on how an mp4 file is built: the file is basically a container for one or more tracks. those tracks each contain one type of media, like audio or video. and every track has its own timeline, its own samples, and its own properties. an example of a sample? a frame of video, bestie. the file also describes how to synchronize the timelines of the tracks and the aggregate properties of the tracks. it's giving project manager energy, honestly. π
the MP4 library is focused on providing an easy to use API for the mp4 file format. it's been used with an encoder, a server, a player, and a number of mp4 utilities. however β and this is important, don't skip it β it may not be adequate for multimedia editors that wish to work directly with mp4 files. those kinds of tools can use it to export an mp4 file, though. (and bestie, the library is open source, so contributions of extensions to the library are welcome!! come thru π)
now, because the whole point is an easy to use API, not all the information in the mp4 file is directly exposed via the API. to accommodate applications that need access to information that isn't otherwise available through the API, there are file and track level generic get and set property routines that use arbitrary string property names. to use these routines you will need to be familiar with the mp4 file specification, or be willing to wade thru the output of MP4Dump() to figure out what you want. see MP4GetIntegerProperty() for more details. iykyk π§
π INVOCATION π
the library API is defined in <mp4.h>, which includes all the necessary dependent include files. one include, all the drama handled for you. iconic.
the MP4 library can be used by either C or C++ programs. the calling convention is C, but if you're using C++ then the default argument feature of that language can be used. yes bestie, you get the little shortcuts. slay.
for example:
MP4Create("foo.mp4", 0, 0, 0); /* OK in C++ and C */
MP4Create("foo.mp4"); /* OK in C++, ERROR in C */
β οΈ look at that second line one more time. MP4Create("foo.mp4"); is OK in C++ but ERROR in C. do not come for me when your C compiler yells at you, i warned you, fr fr π
π¦ EXAMPLES π¦
see mpeg4ip/lib/mp4v2/util and mpeg4ip/lib/mp4v2/test for simple example programs that use the MP4 library.
in particular:
mp4nullcreate.cppβ program that creates an empty mp4 file. literally nothing in it. an empty vessel. main character with no backstory πmp4dump.cppβ simple program to print a text version of an mp4 filemp4extract.cppβ program to read each track and sample and place them in a separate file to ease inspection or recombinationmp4broadcaster.cppβ program to broadcast the hinted tracks of an mp4 file using RTPmp4nullvplayer.cppβ program that reads the video track but doesn't actually render the video
for more complete applications that use the MP4 library, see mpeg4ip/server/mp4creator, mpeg4ip/server/mp4live, and mpeg4ip/player/src. go off, you've got options π
and that's the whole page bestie!! this one's brought to you by Cisco Systems Inc., living at Version 0.9, hanging out in section MP4(3). stay hydrated, read your man pages, and remember: the format can accommodate practically any type of media, and so can you. periodt. πβ¨πΈπ¦π
π¦ where this page comes from
- fedora 43: libmp4v2-devel 2.1.0-0.34.trunkREV507.fc43 Β· LicenseRef-Callaway-MPLv1.1
- fedora 43: libmp4v2-devel 2.1.0-0.34.trunkREV507.fc43 Β· LicenseRef-Callaway-MPLv1.1
- fedora 44: libmp4v2-devel 2.1.0-0.35.trunkREV507.fc44 Β· LicenseRef-Callaway-MPLv1.1
- fedora 44: libmp4v2-devel 2.1.0-0.35.trunkREV507.fc44 Β· LicenseRef-Callaway-MPLv1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms