Test decode integrity with the null muxer
The fastest way to know whether a file decodes without errors from start to end is to run it through the null muxer. FFmpeg decodes every frame, throws the output away, and reports any decode error in real time. It produces no output file, so it costs no disk space.
The command
ffmpeg -v error -i input.mp4 -f null -What it does
FFmpeg opens the file, runs the demuxer, hands each packet to its decoder, and discards the decoded frames into `/dev/null`. If the decoder hits a corrupt frame, missing reference, or unsupported bitstream feature, it logs a warning and keeps going. The exit code is non-zero only if the failure is fatal, so a clean run with a non-zero exit is the rare-but-valid 'the file is broken' signal.
Requirements
Any container and codec FFmpeg was built with. No hardware, no extra flags, no output path. The command makes one full pass over the file, so time is roughly equal to a real decode at the same speed.
Things to avoid
- Using `-v error` only. Omitting it gives you the same data plus a flood of benign 'No accelerated colorspace conversion found' messages that hide the real errors.
- Treating a clean log as proof the audio is intact. The command decodes both streams, but it does not verify timestamps or A/V sync — for that, parse the log for `DTS` discontinuities.
- Running it on a directory full of files with shell glob expansion that includes a corrupt file; you'll get a single error at the end and not know which file failed.
- Confusing `null` muxer with `matroska` muxer and writing the output by accident. The `-` at the end is the convention; without it, FFmpeg may try to interpret the output format from the filename.