I write software C/C++ to recover deleted files, and I need to identify files according to their binary content, so my question is there a simple way to know if a particular file is H.264 format video? is H.264 has an signature?
I saw the code of FFMPEG here, but can it help me, how?
The problem is that H.264 is not a file format, it is a video compression standard, and as such it can be found in multiple file formats. You can have a .f4v encoded with H.264 as much as you can have .mp4 with H.264.
So, how do you solve your issue? Well, I strongly advise you to use a library that does that for you. libavformat, for example, should do the trick (check the
AVFormatContext structures, and the
Now, if you absolutely want to do it without libraries, you can check out the documentation for each video container format that supports H.264 to see how to retrieve the encoding information of the video stream, but expect this to take you at least a month or two.