Using HTML5 I am trying to get the attribute (ie rotation), located in the header of a mp4 (I play it using a video tag), to do this I am trying to get the bytes that make up the header, and knowing the structure, find this atom.
Does anyone know how to do this in javascript?
You can use
mediainfo.js
, It's a porting ofmediainfo
(cpp) in javascript compiled withemsciptem
.Here is a working example: https://mediainfo.js.org/
You will need to include the
js/mediainfo.js
file and putmediainfo.js.mem
file in the same folder.You need to check the sources on this file to see how it works: https://mediainfo.js.org/js/mediainfopage.js
Here is the Github address with the sources of the project:
https://github.com/buzz/mediainfo.js
I do not think you can extract such detailed metadata from a video, using HTML5 and its video-tag. The only things you can extract (video length, video tracks, etc.) are listed here:
http://www.w3schools.com/tags/ref_av_dom.asp
Of course, there might be special additional methods available in some browsers, but there is no "general" approach - you would need more than the existing methods of HTML5.