View Full Version : ogm+mkv header question
Kotu
20th June 2004, 12:51
not sure if this is the right place to ask this, ill explain what im trying to do first.
Ive made up a perl script which reads from avi files the frame rate and video dimensions, i also want to do the same thing with ogm and mkv files but obviously the headers are quite different. I got the information about the avi header from http://www.fastgraph.com/help/avi_header_format.html. Is there anything like this anywhere for ogm+mkv or does anyone know the offsets to read the dimensions+frame delay+total frames.
Thanks for any assistance.
alexnoe
20th June 2004, 14:01
There is no OGM docu (that's one of the major reasons why it's so crappy), and for MKV (http://www-user.tu-chemnitz.de/~noe/Video-Zeug/matroska_docu/matroska.pdf), the frame rate is not necessarily stored in the headers (especially if the frame rate is not constant).
The AVI header info you linked to is also nonsense. There are no fixed positions inside an AVI files, so claiming that the described structure starts of offset 32 shows a great amount of disknowledge of its author. It works for many files, but that structure could start later without any problem.
Go to www.wotsit.org and find a better AVI file format docu, while i'm still working on a proper one.
Kotu
20th June 2004, 14:29
thanks for the info so far, the avi stuff from that page has worked for me so far but i have only tested it with about 30 videos, if i start getting problems later then i will know what is causing it :)
Koepi
20th June 2004, 15:43
Unfortunately, the OGM documentation is the source code. Find it in xiph.org's CVS repository.
If you look at the splitter code, you'll find the routines you need - which extract the info you are looking for.
(There's nearly no better documentation than the source ;) no matter what some trolls try to convince you of...)
Regards
Koepi
alexnoe
20th June 2004, 15:46
Then someone could at least take the time to gather all info from the source code and make a proper docu from it. But OGM is not worth the time it takes...(proof: if it were worth the time, then someone would have done it already. OGM has existed long enough for that. As this obviously is not the case, it is proven that it is not worth the time ;) )
There's nearly no better documentation than the source Only a really stupid p'tagh could contradict to that: The only existing docu is always the best one and the worst one at the same time, so the source code is of course the best one...
Kotu
22nd June 2004, 21:00
ive looked through http://matroska.free.fr/technical/specs/index.html and managed to get the dimensions and the fps for mkv but i cannt seem to find how to get the total video length (length of first track would be fine). Which element should i be using to get it?
The xiph.org cvs repository doesnt seem to be working at the moment but if the code is anything like the mkv code then i don't think ill be able to understand it anyway (i am quite the novice at programming).
alexnoe
22nd June 2004, 21:44
SegmentDuration and TimecodeScale
Kotu
23rd June 2004, 18:58
the timecodescale didnt appear in any of the videos i tried so ive ignored it for the moment, will probably add something for it later if i come accross some bad data :)
So i have avi and mkv sorted now but im still having problems with the ogm header. The mkvinfo program was quite useful for mkv files because it gave the offset of the values, is there anything like this for ogm files? There is an ogminfo program mentioned at xiph.org but there isnt any links to it, i did manage to find one via google but it didnt really give much information (hoping the one which was at xiph.org might be better).
Thanks a lot for the help so far, almost there now :D
alexnoe
23rd June 2004, 19:08
As you can see on the spec page, TimecodeScale is 1 mio if it is not present.
jcsston
23rd June 2004, 21:57
Originally posted by Koepi
(There's nearly no better documentation than the source ;) no matter what some trolls try to convince you of...)
Obviously you haven't developed long...
Why do you think there are many tools to generate documentation from source code if the source code itself is better?
Kotu
24th June 2004, 12:48
I tried to get some help from the vorbis irc room but they said they didnt know much about ogm (although they get asked a lot) with regards to containing other formats. One person said that the header in the ogm should be the same as the avi once the track is found. After going through the ogm and an avi (the video pulled using virtual dub) i found them to be quite different (using hex editor). There is a page at http://tobias.everwicked.com/packfmt.htm which has a bit of information but it didnt help me find what im after. Is there anyway of contacting the people who made the ogg container store videos? I tried the email link on the site above but the email got returned to me as a bad address.
All i need to find in the ogm file now is the number of frames but i cannt seem to pull any information from the header which releates to this :(
alexnoe
24th June 2004, 13:51
Not 'the people' but 'the person'. I know that you would actually need at least 2 people to gather as much shit in one place as it has been done with OGM, though :confused:
As OGG files don't contain any duration values, OGM probably doesn't either. You have to find the last page using trial&error method (OGG/OGM doesn't support reasonable seeking), and look at its samplestamp.
I guess you now start to see why I probably will never support OGM reading in AVI-Mux GUI :)
Why do you think there are many tools to generate documentation from source code if the source code itself is better?Hihi. Probably a desperate attempt of saying something a really stupid person might believe...
Koepi
24th June 2004, 14:42
Well well, the matroska team from it's best and inner side again.
Thread closed.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.