o.elias
o.elias

Reputation: 473

Checking ogg-Files using Python on OSX and Linux

I am writing a python module which checks several media and document formats whether the files correct or somehow corrupted/wrong formatted. It returns an error message or - if the file is correct - some information about the file (e.g. framerate, channels, ...)

Now I am looking for a python module which I can use to check ogg-Files. There is no need to play the file, it should simply return an Exception if the file seems not to be a correct ogg-File.

It should run on OSX and Linux. At the moment I am tending to python-ogg. But I think it will be some work to get it running on OSX 10.6 and perhaps there is an easier solution when there is no need to play the files.

Best regards!

Upvotes: 2

Views: 864

Answers (1)

Scott Griffiths
Scott Griffiths

Reputation: 21925

Have you looked at Hachoir? It 'extracts metadata from multimedia files', including Ogg Vorbis.

The different file format parsers give differing levels of detail, and I haven't tried the Vorbis one, but it might be what you are looking for. Here's an example of metatdata extraction from an AVI file:

$ hachoir-metadata pacte_des_gnous.avi
Common:
- Duration: 4 min 25 sec
- Comment: Has audio/video index (248.9 KB)
- MIME type: video/x-msvideo
- Endian: Little endian
Video stream:
- Image width: 600
- Image height: 480
- Bits/pixel: 24
- Compression: DivX v4 (fourcc:"divx")
- Frame rate: 30.0
Audio stream:
- Channel: stereo
- Sample rate: 22.1 KHz
- Compression: MPEG Layer 3

Upvotes: 2

Related Questions