I have to design a module that detects mp4 files. If will get any random file as input and it has to tell whether it is a mp4 file or not. Where can I find the specification of headers for the mp4 file? Tried googling but could not find anything except the signature. Any other tips regarding C programming for the module?
you can check the extension or the file signature (magic number)
http://www.garykessler.net/library/file_sigs.html
http://en.wikipedia.org/wiki/List_of_file_signatures
00 00 00 18 66 74 79 70 33 67 70 35 ....ftyp 3gp5 MPEG-4 video files
Or if you're on Unix/Linux you can parse the output of file(1) from your program.
Edit:
You don't need to scan the whole file to identify it, the signature will do, however, if you have to, note that MP4 is a container for other formats, which means you will probably need to know about MP4 and other formats it contains as well, there's some information here: http://en.wikipedia.org/wiki/MPEG-4_Part_14
I'd use something like libffmpeg to do that instead.