Before converting a video, or when a TV refuses to play one, I want to know what is inside the file. ffprobe comes with FFmpeg and answers that.
ffprobe -v error -show_format -show_streams video.mkv
ffprobe -v error -show_streams -of json video.mkv
-show_format prints information about the container, in a section called FORMAT. -show_streams prints each stream in its own STREAM section, with the codec, the resolution or sample rate and more. -v error keeps the banner and the log lines out of the way, so only the data is printed.
The -of json option writes the same information as JSON, which you can then pass to jq for a single field.
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,width,height -of csv=p=0 video.mkv
The result of that last command is one line such as h264,1920,1080.
The caveat is that ffprobe only reads the headers. It tells you what the file claims to contain, not whether the data is intact. For that, run a decode with ffmpeg -v error -i video.mkv -f null - and see if any errors are printed. Also keep in mind that ffprobe can be slow on files over a network share.
Further reading: ffprobe documentation