brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: avmediainfo prints a media file's tracks and codecs on a Mac

Media
~/tips/tip-media-avmediainfo-report

avmediainfo holiday.mov

Shows what is inside a video without installing any extra tools.

Before blaming a player, I want to know what the file really contains. macOS ships an inspector for that, tucked away in the terminal.

Point it at a file:

avmediainfo holiday.mov

You get the duration and track count, then a block per track. For video that means codec, dimensions, frame rate and data rate, and for audio the format, sample rate and channels. There is also a line saying whether the system can decode the track, which answers the question of why QuickTime shows black while the sound plays.

For a quick glance there is a shorter form:

avmediainfo holiday.mov --brief

And for the tags stored in the file:

avmediainfo holiday.mov --metadata all

That last one is worth a look before you send a recording to strangers, since location and device details can be in there.

It reports errors it runs into while parsing and ends with a count, which makes it a cheap first check on a file that arrived damaged. A clean report isn’t proof that every frame plays, though.

The limit is format support. This is Apple’s media framework, so it is at home with MOV, MP4 and M4A, and not with every container you might download. For an MKV I’d reach for ffprobe instead.

Further reading: avmediainfo man page

More Media tips avconvert -s clip.mov -o clip-720.m4v -p Preset1280x720 ffmpeg -f lavfi -i testsrc2=size=1280×720:rate=30 \ rpicam-still --timeout 30000 --timelapse 2000 -o timelapse/image%04d.jpg wp media regenerate --only-missing --yes All Media tips (5) All topics

Link