Manatee

How to check which codec a video uses on a Mac

To check which codec a video uses on a Mac, select the file in Finder, press Command-I, and read the Codecs line under More Info. It names the video codec and the audio codec, for example H.264 and AAC. QuickTime Player’s Movie Inspector shows the same thing with more detail, and Terminal can report it for a whole folder at once. If no codec appears at all, that is an answer too, and it is covered below.

Why the extension does not tell you

MP4, MOV, MKV and AVI are containers: the wrapper that holds the picture, the sound and the timing together. The codec is the method used to compress the picture or the sound inside that wrapper. Two files that both end in .mp4 can hold different codecs, which is why one plays and the other does not, and why an upload form accepts one and rejects its twin. Container vs codec explains the distinction in full.

The quick check in Finder

  1. Select the video in Finder.
  2. Press Command-I, or choose File, Get Info.
  3. Open the More Info section if it is collapsed.
  4. Read the Codecs line. Dimensions, duration and audio channels sit beside it.

To check several files without opening a window for each, choose View, Show Preview. The same details appear in a pane on the right as you arrow through the folder, and View, Show Preview Options lets you choose which lines it shows.

Camera files often list a third entry, Timecode. That is a timing track the camera wrote for editors, and it is harmless.

More detail in QuickTime Player

Open the video in QuickTime Player and choose Window, Show Movie Inspector, or press Command-I. The inspector lists the video codec with its resolution and frame rate, the audio codec with its sample rate and channels, and the data size and data rate of the whole file.

The data rate is the useful extra. It is how much data the file spends on each second of playback, and it explains a file that seems far too big for its length. The inspector only works for files QuickTime Player can open, so a file it refuses needs one of the other methods.

Checking from Terminal, including a whole folder

Spotlight stores the codec names when it indexes a video, and mdls reads them back:

mdls -name kMDItemCodecs ~/Movies/clip.mp4

For every MP4 in a folder, go to the folder in Terminal and run:

for f in *.mp4; do echo "$f"; mdls -name kMDItemCodecs "$f"; done

Change *.mp4 to *.mov for QuickTime movies. A reply of (null) means Spotlight has nothing for that file: the drive is not indexed, or macOS does not understand the container.

For an audio file, afinfo answers a question Finder often leaves vague. Run afinfo song.m4a and read the Data format line: it says aac for an ordinary compressed file or alac for Apple Lossless, two very different things that share the .m4a extension.

When macOS shows no codec at all

A missing Codecs line usually has one of two causes.

  • The container is one macOS does not read. MKV, WebM, AVI, WMV and FLV files generally show no codec in Get Info, because Finder cannot look inside the wrapper. For an AVI, the plain command file clip.avi in Terminal often prints the video and audio codec names along with the resolution. For the others, a free media inspector tool will name the codec if you need it.
  • The file is damaged. An MP4 or MOV that also shows no duration and no dimensions has probably lost its index, the part that describes what is inside. How to check whether a video file is corrupted covers the tests for that.

In practice you rarely need the name in the first case. A file with no Codecs line that will not open in QuickTime Player needs converting whichever codec it holds.

What the names mean, and which ones play

  • H.264, also written AVC. The most widely supported video codec. It plays on practically any device, and it is the safe choice for sending.
  • HEVC, also written H.265. The default on recent iPhones. Files are smaller than H.264 at similar quality, but older computers, televisions and some upload forms refuse it. H.264 vs HEVC covers who can open what.
  • Apple ProRes. An editing codec. It plays on a Mac, the files are very large, and most other devices will not take it.
  • AV1 and VP9. Codecs built for web video. Whether they play depends on the Mac and the app; AV1 video will not play on your Mac has the details.
  • MPEG-4 Video and MPEG-2. Older codecs from the era of early camcorders and DVDs. Support on current devices is patchy.
  • AAC, MP3, Linear PCM, Apple Lossless. Audio codecs that a Mac plays without trouble. AAC is the one to expect in a file meant for sharing.

If the goal is just to make it play

Often the codec name is only a step toward a file that opens. Manatee skips that step. Open it, choose Convert, drop the video in, and pick MP4 or MOV. It accepts MKV, WebM, AVI, WMV, FLV and the other containers macOS will not read, and you do not have to identify the codec first. The result is written as a new copy beside the original, which is never modified. The work happens on the Mac with nothing uploaded.

If the file turns out to be damaged instead of unsupported, Repair mode is the one to use. It reports Fixed, Partial (the first eleven minutes of a video, for example) or Not fixable, and it is honest about which. Manatee is not a video editor, so trimming and titles are jobs for another app. Every feature is free for 24 hours, then it is $9 once.

For the codec name itself, Finder and QuickTime Player remain the places to look.

Questions

Why do two videos from the same iPhone show different codecs? The camera setting changed between them, or one is a copy. In the iPhone’s Settings, Camera, Formats, High Efficiency records HEVC and Most Compatible records H.264. A copy that came through a messaging app has often been re-encoded on the way.

Does the codec change the file size? Yes. Size is the data rate multiplied by the length, and each codec needs a different data rate to look good. HEVC needs less than H.264 for similar quality, and ProRes needs far more than either.

Can I change the codec without converting the file? No. Changing the codec means re-encoding the picture or the sound. Changing only the container is a different and lossless job, which remux versus re-encode explains.