How to find out the codec used by a video file?

I do it with ffmpeg:

ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 <file>

01

02

stackoverflow.com/a/29610897

See also: Which video codec is used by iPhone?