Check video duration

inspection

// what it does

A minimal one-liner that prints just the container's declared duration in seconds as a float, e.g. `212.480000`. `-show_entries format=duration` picks the single field, `-of csv=p=0` drops the label, and `-v error` ensures the output is nothing but the number — trivial to capture in a variable or compare in a script.

// shell

$ ffprobe -v error -show_entries format=duration -of csv=p=0 input.mp4

// gotcha

This reads the duration the container declares in its header, which can be missing or wrong for formats like MPEG-TS or raw/streamed files — it may print `N/A`. When you need a guaranteed-accurate length you have to actually decode the stream (e.g. count packets) rather than trust this field.