mplayer -identify will do the trick. Only the ffmpeg call in the file will also work - it will automatically print the set of information at the beginning about the input file, regardless of what you actually say ffmpeg.
Of course, if you want to do this from your program without calling exec in an external program, you can simply include avcodec libraries and run your own authentication procedure directly.
While you can implement your own discovery, it will certainly be worse than existing routines, given the huge number of formats supported by libav *. And that would be a pretty stupid case when reinventing the wheel.
The Linux file command can also do the trick, but the amount of data it prints depends on the video format. For example, in AVI it provides all kinds of resolution data, FOURCC, fps, etc. While for the MKV file it just says โMatroska dataโ, without reporting anything about the internal components or even the video and audio formats used.
Dark shikari
source share