Log in

View Full Version : Cannot extract ogm file info !


tHe gLouCh
22nd June 2003, 11:23
Help is needed !

I cannot extract infos from video stream in an .ogm file using the VorbisFile library.

It seems that I can only open .ogg files (audio)! When I call "ov_open_callbacks" it generates a message error.

Here is my procedure in pascal:

procedure GetOGMInfo;
var
F : TFileStream;
vf: OggVorbis_File;
res: integer;
begin
F := TFileStream.Create("OGM FileName", fmOpenRead);

res := ov_open_callbacks(F, vf, nil, 0, ops_callbacks);
if res < 0 then // always return -132 !! No Vorbis info/file
begin
F.Free;
exit;
end;

**** code to get info ****

end;

What call must I use to open the "FileName".ogm file & get the video stream info (duration, bitrate, etc...) ?

Suiryc
23rd June 2003, 21:03
As its name says the VorbisFile library is meant to work on Vorbis files.
The only common thing between OGM and Vorbis files is the format they use, i.e. Ogg.
Moreover OGM specs hasn't been defined by XipH (which defined Ogg & Vorbis).

If you want to get information from the file you will need to use the Ogg library (libogg) to get Page/Packets from the OGM file, and then use Tobias Waldvogel specs (OGM, http://tobias.everwicked.com/ http://tobias.everwicked.com/packfmt.htm) to get the information you want from the header Packet(s).
When the track appears to be an Ogg Vorbis track then you will need the Vorbis library (libvorbis) to get useful information from the header Packets.