.fw files.wiki
MP4

MP4 Files

MPEG-4 Part 14 MP4 Media File

An .MP4 file is an ISO-based multimedia container used to store video, audio, subtitles, chapters, and metadata.

MPEG-4 Part 14 MP4 Media File

Most common
Developer
ISO/IEC Moving Picture Experts Group (MPEG)
Category
Video
MIME type
video/mp4
Format
Container
Magic bytes
66 74 79 70 @ offset 4
First released
2001
Latest version
ISO/IEC 14496-14:2020
Open standard
Yes

MPEG-4 Part 14 Audio-Only MP4 File

Developer
ISO/IEC Moving Picture Experts Group (MPEG)
MIME type
audio/mp4
Format
Container
Magic bytes
66 74 79 70 @ offset 4
First released
2001
Latest version
ISO/IEC 14496-14:2020
Open standard
Yes

Fragmented MP4 / CMAF-compatible MP4 Segment

Developer
ISO/IEC MPEG
MIME type
video/mp4
Format
Container
Magic bytes
66 74 79 70 @ offset 4
First released
2012
Latest version
ISO/IEC 23000-19:2020
Open standard
Yes

Online .MP4 Text Viewer

Reading file…

What is a .MP4 file?

.mp4 stands for MPEG-4 Part 14, which is the name of an ISO/IEC Multimedia File Format created and published as ISO/IEC 14496-14 in 2001. In fact, .mp4 comes from the QuickTime File Format through ISO BMFF (ISO Base Media File Format). .mp4 refers to a video container as well; however, it contains different elements such as video, audio, subtitles, still picture, chapter, and even metadata, depending on playback capability. The codec used inside it includes H.264 / AVC, H.265 / HEVC, AV1, MPEG-4 Visual, AAC, ALAC, MP3, AC-3, E-AC-3, as well as Timed Text.

There are plenty of sources that use the .mp4 container format including mobile phone camera recording videos, screen recorder, downloading files (for example online videos on YouTube, Facebook, or Twitch live streams), podcasts etc. Also sometimes the audio file may have that container (.mp4); .m4a is more popular extension format for those type of audio codecs (such as AAC, ALAC).

In most systems, the usage of both formats .MP4 and .mp4 is interchangeable (case insensitive). There must be a signature (ftyp box in particular at byte offset 4) of ISO BMFF.

How to open a .MP4 file

Open a .MP4 file on Windows

  1. 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
  2. 2 Double-click your .MP4 file if you have an app for .mp4 files on your computer. In case it does not open, move on to step three.
  3. 3 Right-click your .MP4 file -> select Open with -> Choose another app.
  4. 4 Choose VLC media player in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .mp4 files" and click OK.

Still not opening? See common problems and fixes.

Programs for Windows

Open a .MP4 file on macOS

  1. 1 In the Finder app, locate your .MP4 file.
  2. 2 Just double-click your .MP4 file in order to automatically launch the program which is connected with it.
  3. 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select Open With -> VLC media player.
  4. 4 If it isn't in the list, choose Other… and find the application manually.

Still not opening? See common problems and fixes.

Programs for macOS

Open a .MP4 file on Linux

  1. 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
  2. 2 Double-click the file.
  3. 3 Or choose another program by right-clicking the file -> Open With -> VLC media player.
  4. 4 Install VLC media player (if it is not installed on your computer) from the software centre, repository or Flathub.

Still not opening? See common problems and fixes.

Programs for Linux

Open a .MP4 file on Android

  1. 1 Launch Files or another file management app.
  2. 2 In Downloads, find the .MP4 file and open it by tapping.
  3. 3 A list of apps capable of opening the file will be shown. Tap VLC media player and press Always to permanently connect the file type with this app.
  4. 4 No apps able to open this file? Download VLC media player from the Google Play Store.

Still not opening? See common problems and fixes.

Programs for Android

Open a .MP4 file on iPhone / iPad

  1. 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
  2. 2 Tap the .MP4 file you want to open.
  3. 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
  4. 4 Touch and hold the file to get the context menu -> choose Share -> select VLC media player from the list of apps.
  5. 5 If there is no such option, download the app first from the App Store and then tap the document again.

Still not opening? See common problems and fixes.

Programs for iPhone / iPad

Open a .MP4 file online

  1. 1 Move to the online viewer at the top of this page.
  2. 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.

Still not opening? See common problems and fixes.

Programs for Online

More details about opening .MP4 files

On Windows OS 10 and 11, many files ending with .MP4 format are associated with Media Player. In case your file contains HEVC videos then use MS’ HEVC Video Extensions or other media player which has built-in decoder (VLC is always a good option). When working on macOS, open MP4 files using QuickTime; H.264-AAC and many of HEVC files open through this software and are also previewed in Apple Finder, Photos, iMovie or Final Cut Pro applications. Under Linux, the preferred software is usually VLC, mpv or GNOME Videos, along with Kdenlive and similar FFmpeg-based applications. Here is worth mentioning though that sometimes support of H.264, HEVC, or AAC is required from your OS or a particular package. Android will allow you playing the MP4 files via apps like Google Photos (as a cloud viewer), Photos app (gallery viewer for android devices), VLC or Gallery Viewer of your device. Under iPhone/iPad try Files app, Photos, Safari Browser, or video editor applications that support contained codecs: iMovie and more professional editors. You can also open your MP4 files in most browsers (html5 video tag) using h.264+aac MP4 format but HEVC/Av1/AC-3+sub-titles may vary among browsers/os.

The following applications are commonly used when working with video editing, whether professional: Adobe Premiere Pro, DaVinci Resolve, Final Cut Pro, Avid, or other depending on os/application used. In case opening via click didn’t work, try opening in VLC and inspect your mp4 file with MediaInfo. A real mp4 should have the "ftyp" signature on byte offset 4 in your file - otherwise you have something else than mp4. Renaming is not recommended till you've checked this part. You have problems with file opening on an OS? Fix file-association issue under Windows settings/finder "Get Info tab" for Mac/and also under Share/Open with tabs on iOS&Android OSes. Cloud viewers Google Photos/iCloud Photo/OneDrive/Youtube etc. play files upon uploading them (process may last some time).

Technical details

An MP4 file is neither human-readable nor editable as text. MP4 is a binary container, not a text based one, and thus built with a series of boxes, sometimes called atoms where in each atom comes first size field then followed by four character type ftyp, moov, mdat, free, trak, mdia, minf, stbl, udta. And the signature will generally come in as the first atom - the ftyp, which consists of four bytes of size information starting offset 0 and ASCII value 'ftyp' - which will correspond to hexadecimal values 66 74 79 70.

FTYP specifies file's Major Brand and Compatible Branded Lists of this particular format's brand names - including, amongst others; isom, iso2, mp41, mp42, avc1, M4A, dash, cmfc, cmfs, that tells parser what the MP4 profile/delivery format is. Latest format specification published in 2020 - ISO/IEC 14496-14:2020 and the common MIME Type includes video/mp4, audio/mp4 and application/mp4.

Encoded samples will be present in the mdat box whereas metadata - as part of movie structure such as timing information and media track layout are part of the moov box - movie header box. Movie header is best to have in the beginning for Progressive Delivery - where movie timing and metadata are needed in order to allow the player read movie structure right from the very beginning, however, in the case where moov will follow after mdat, playback might have to wait until whole file has been downloaded.

For fragmented MP4 file formats - moof, traf, tfhd, trun and mfra boxes exist in order to be able to segment a stream into separate media fragments and this is used for DASH/CMAF based delivery. The container itself does not do compression but rather codecs in these boxes are capable of lossy and lossless streams, intracoding and inter-framed as well as encryption. MP4 files vary from a few KB to many GB - with related file extensions such as '.m4a' and '.m4v'.

How to convert .MP4 files

In case the playing device cannot decode the codec inside an .MP4 file, but the file still needs to be .MP4 for a phone or browser, transcode in a common H.264/AAC codec profile using HandBrakeCLI: HandBrakeCLI -i input.mp4 -o output.mp4 --encoder x264 --aencoder av_aac --quality 22. In cases where everything except the container appears fine, it is possible to remux the files in the format of Matroska via ffmpeg -i input.mp4 -map 0 -c copy output.mkv since that will allow moving metadata and subtitle and multiple other channels to a new format without losing the content.

The common format for videos in workflows of either Apple or in post-production is the MOV one, which can also be converted with: ffmpeg -i input.mp4 -map 0 -c copy output.mov. Videos to be delivered to the web are commonly WebM with either AV1 or VP9 coding in addition to opus for sound compression: ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 0 -crf 32 -c:a libopus output.webm. Note that transcoding takes some more efforts/time with a possible drop in quality of video. When the video is not required, just keep the sound and convert in formats like mp3, aac, WAV, flac. Formats like GIF/WebP/APNG/image sequences only make sense for very short clips, since they carry no audio and compress far worse than video codecs. For adaptive streams one would have to create fragmented mpeg/DASH/HLS streams via MP4Box/Bento4/Shaka Packager/FFmpeg. Any transcoding may lead to loss of any special feature of your video (including hdr/dv/sound/subtitles/chapters/timecodes/gps).

Convert toToolCommand / note
MKV FFmpeg ffmpeg -i input.mp4 -map 0 -c copy output.mkv Remuxes streams without re-encoding when the codecs are supported by Matroska; preserves quality but may change metadata layout.
MOV FFmpeg ffmpeg -i input.mp4 -map 0 -c copy output.mov Useful for Apple editing workflows; copy mode avoids quality loss if the contained codecs are compatible.
WebM FFmpeg ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 0 -crf 32 -c:a libopus output.webm Re-encodes for open web delivery; smaller files are possible but generation loss occurs.
MP3 FFmpeg ffmpeg -i input.mp4 -vn -c:a libmp3lame -b:a 192k output.mp3 Extracts and converts audio only; video, subtitles, chapters, and most timed metadata are discarded.
GIF FFmpeg ffmpeg -i input.mp4 -vf "fps=12,scale=480:-1:flags=lanczos" -loop 0 output.gif Creates a short animated GIF; no audio, limited color, and often much larger than modern video.
H.264/AAC MP4 HandBrakeCLI HandBrakeCLI -i input.mp4 -o output.mp4 --encoder x264 --aencoder av_aac --quality 22 Transcodes to a broadly compatible MP4 profile for phones, browsers, and TVs; re-encoding reduces quality.
Fragmented MP4 for streaming MP4Box MP4Box -dash 4000 -frag 4000 -rap -segment-name segment_ input.mp4 -out manifest.mpd Produces DASH/CMAF-style fragmented MP4 segments and a manifest for adaptive streaming workflows.

Common problems and fixes

The presence of "moov atom not found" means that MP4 video header was damaged, chopped off, etc. It is necessary to retrieve file from camera or phone's backup and copy it or run special recovering applications untrunc, recover_mp4, and similar tools. When using the software FFmpeg the error "Invalid data found when processing input" could indicate download which has been interrupted prematurely, misnaming and incorrect extension of file used and incorrect box sizes. One has first to check signature of file, since proper file should show ftyp at byte offset 4, containing such hex bytes as 66 74 79 70, then to use ffprobe for further checking purposes.

When video does not work but audio works fine the problem is in codec of video and could be related to hevc, av1 and 10 bit h.264 files. VLC should properly play some part of such file, usually, the solution lies in transcoding video into more appropriate h.264 version. When audio disappears on the contrary, the problem can be associated with usage of audio codecs as ac3, e-ac-3 and dts or certain layout of AAC, where player cannot read them correctly. Conversion to AAC or proper coding solves that.

In the case when browser displays only black box or shows message "No video with supported format and MIME type found" the problem might be caused by an unsupported codec in the file, incorrect MIME type at server side or location of box moov to the end of video. That kind of layout would cause seeking troubles, and playing starts only when the whole download of that file is ready. Solution lies in using the command: ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4. In addition, improper rotation after converting means that display matrix has been ignored. Incorrect sync in audio could arise because of different frame rates of captures, incorrect edit list and sample losses. DRM-protected files can only be played in certain authorised programs.

Security considerations

The MP4 format itself is a container and not executable, nor does it offer macro functionalities comparable to those of Microsoft Office packages. The greatest danger lies in incorrectly formatted data for box sizes, codec bitstreams, subtitle or image data leading to exploitable vulnerabilities in the parsing, demultiplexing, decoding, and graphics card driver. Therefore, it is recommended to have your browsers, players and any other multimedia software (including VLC, FFmpeg, HandBrake etc.) updated before playing any potentially dangerous MP4 content. Please never open dubious file with outdated media application or in any kind of privileged mode, instead run the program inside sandbox or use a special VM for such purposes. Moreover, note that the MP4 allows for embedding the creation timestamps, brand/device model, geolocation and unique identifier of camera and video codecs, as well as edit log data, which makes inspection or stripping metadata with the help of programs like ExifTool and ffmpeg absolutely indispensable before publication.

History and versions

MP4 descended from Apple's QuickTime File Format, whose contribution towards MPEG-4 part 12 is known as the ISO base media file format. MPEG-4 part 14, ISO/IEC 14496-14, was standardised in 2001 as a container for storing MPEG-4 visual and audio objects based on said ISO base format. The second iteration from 2003 brought compatibility between MP4 and subsequent iterations of MPEG-4 systems, often denoted by mp42. Incorporation of H.264/AVC made MP4 become the most popular consumer and web-based container through much of the late 2000s and 2010s. In the context of HTML5-based video playback era, an H.264+AAC MP4 file format has become de facto standard for browsing despite patent/license issues of its codec implementation. Fragmented MP4 has been central for adaptive streaming standards such as MPEG-DASH and Apple's HLS, displacing previously utilised MPEG-2 Transport Stream. CMAF, ISO/IEC 23000-19, defined fragmented MP4 in ways to enable re-use of the same segments for delivery via both DASH and HLS. MP4 containers now support advanced video formats like HEVC, AV1, HDR10, Dolby Vision as well as immersive audio and timed metadata.

MOV file format, which is the natural container of QuickTime, is very close to MP4 in terms of technicality, but MP4 should definitely be the safer choice for use on web pages due to the high level of its support. M4V is another file format, related to video and created by Apple in the image of MP4; it could be often connected with deliveries from iTunes and/or Apple TV. There is a huge number of M4V files that lack protection and represent regular MP4 containers, as well as M4A format for audio that is usually applied for songs only. MKV format could have more advanced codec and subtitle support compared to MP4, as well as chapter, but it has worse level of compatibility with devices such as phones, televisions or web browsers, than MP4 file format itself. WEBM is one more file format that resembles Matroska but was developed for the Internet environment and works better in web browsers while AVI is somewhat old-fashioned format. TS/M2TS resembles broadcast/Blu-ray and, compared to fast-start MP4, represents a less suitable choice for progressive web delivery. 3GP, 3G2 and FLV are other legacy mobile or Flash formats.

Comments (0)

Replying to

No comments yet. Be the first to share your experience with this file type.