2

I have an Ogg Theora file, but unfortunately the display ratio is incorrect on it. I know that it's possible to edit the metadata without reencoding.

What tool can do the job? Preferably something that can be run on *nix.

ogginfo from vorbistools gives the metatada that i would like to edit, but that package doesn't provide anything to change the values, liboggz doesn't seem to do the trick either.

I have attempted to play around with the hexeditor, here's what i've found. Here is my theora packet:

 00000000:  4f 67 67 53 00 02 00 00  00 00 00 00 00 00 00 00  OggS............
 00000010:  00 00 00 00 00 00 70 e4  97 9a 01 2a 80 74 68 65  ......p....*.the
 00000020:  6f 72 61 03 02 01 00 2d  00 24 00 02 d0 00 02 40  ora....-.$.....@
 00000030:  00 00 00 00 00 19 00 00  00 01 00 00 c9 00 00 6a  ...............j
 00000040:  00 03 0d 40 00 80 4f 67  67 53 00 02 00 00 00 00  ...@..OggS......

The 00 00 c9 00 00 6a block is where pixel aspect ratio is being stored, as i understand it the first 3 words are the numerator, and the second 3 denominator.

If i change the values only in the first packet, then avprobe does return the changed values, but then all video players i've tried panic. Any hints on how to change the other packets so that they conform?

2
+50

The player panic you are experiencing might be due to the checksum in the ogg header. If you recalculate the checksum for the whole header with your new value you might get a valid file again. http://en.wikipedia.org/wiki/Ogg#Page_structure

Though I dont know all too much about the ogg and vorbis specs. For this kind of low level work its always a good idea to read the specs. http://xiph.org/vorbis/doc/Vorbis_I_spec.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.