[theora] Small utility to modify Theora file aspect ratio / frame rate / cropping

hb at x256.org hb at x256.org
Mon Jul 10 20:41:54 PDT 2006


Hello,

I encoded a bunch of theora video files from my DVDs. I thought for a long
time that mplayer was broken because it displayed the aspect ratio wrong.
Then I found out that the aspect ratio I was specifying was supposed to be
the pixel aspect ratio, not the video aspect ratio. (This is extremely
confusing and I urge you to change the semantics of encoder_example. I also
urge you to check for the out-of-disk-space condition. But anyway...)

Rather than re-encode all my videos, which would have taken weeks, I wrote a
little program to fix them. It's a little crude and I'm sure anyone who
looks at the source will be shocked at the liberties I have taken, but it
seems to work. However, if you decide to use it, PLEASE try it on copies of
files first. It could corrupt files. I can't provide any warranty for it.
Use it at your own risk.

Having said that, it works for me, and I'm happy to make it public domain.
As well as changing the aspect ratio you can also display Theora
information, change the frame rate and perform some cropping. It assumes the
first packet in the ogg file is the theora main header; this is true of the
files I created with encoder_example but may not be true of all files. If
someone has such a file and decides to fix it, great, please send me a patch
:)

I hope you find this to be useful. But please use it with caution. Here is
the URL:

http://x256.org/~hb/theoramod-0.9.tar.gz

The rest should be self-explanatory. You need libogg installed to compile
it, of course.



Nicholas



P.S. mplayer can't seek since I upgraded to Alpha6, but xine can. I'm not
all that surprised since mplayer seems pretty dodgy but it would be awfully
nice if someone could fix it. For now I'll just use xine. And, Theora is
great!


More information about the theora mailing list