Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

How to detect H.264 encoded video programmatically?


Thanks.....
Posted

1 solution

I don't use H.264 but you can combine between some tools/techniques to get what you want:

[Method-0 : hard]
you read start bytes of file (maybe this like BOM, and compare it with H.264 signature)

[Method-1 : easy]
you FFMPEG command "ffmpeg -i yourfile" get output by using your preferred programming language, and search for video format in output.
 
Share this answer
 
Comments
vinodkalanji 28-Jun-10 1:15am    
Hi Adrabi,

Thanks a lot for suggestion.
vinodkalanji 28-Jun-10 1:21am    
Hi Adrabi,
I am making a plugin using javascript in which I have to put the logic to detect H.264 encoded video. Is it possible to use ffmpeg command's in other than programming languages(I mean in javascript?)?
Adrabi Abderrahim 28-Jun-10 5:23am    
I think if you use "JavaScript OLE Automation", you can do it, but can work only in local and windows.

or you can use Ajax technique, by creating php or like for executing command, and returns formated results as XML or like to manipulating it by javascript.
vinodkalanji 28-Jun-10 23:32pm    
Hi Adrabi,
Thanks for the guidance. But my lead told to go with Method-0 as mentioned by you. But I didn't get a proper link to read about H.264 signature. Can you please suggest some links for that?...

Thanks...
Adrabi Abderrahim 29-Jun-10 3:01am    
maybe here : http://www.garykessler.net/library/file_sigs.html
example all my mp3s started with (494433)
also
source x264 : http://git.videolan.org/?p=x264.git;a=tree;
source JM: http://iphome.hhi.de/suehring/tml/doc/ldec/html/files.html
RTP Payload Format for H.264 Video : http://tools.ietf.org/html/rfc3984

Good-luck

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900