MP4(3)

πŸ“¦ version 2.1.0, in fedora 43, fedora 44

πŸ’– 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 file
  • mp4extract.cpp β€” program to read each track and sample and place them in a separate file to ease inspection or recombination
  • mp4broadcaster.cpp β€” program to broadcast the hinted tracks of an mp4 file using RTP
  • mp4nullvplayer.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