[Theora-dev] Encoding theora...
illiminable
ogg
Tue Jun 29 22:32:06 PDT 2004
----- Original Message -----
From: "Timothy B. Terriberry" <tterribe at vt.edu>
To: "illiminable" <ogg at illiminable.com>
Sent: Wednesday, June 30, 2004 3:30 AM
Subject: RE: [Theora-dev] Encoding theora...
> >In the yuv_buffer i'm sending in... i am just setting
> >
> >y_stride = y_width = videoWidth
> >uv_stride = videoWidth/2
> >y_height = videoHeight
> >uv_height = videoHeight/2
> >
> >Making the y buffer (width*height) and each of u and v (width*height/4)
> >
> >Am i correct in doing this ? I knwo stride needn't equal width... but
from
> >the videos width, can i just make them equal ? Any restrictions ?
>
> The stride you provide is derived from the layout in memory of your frame
> data. If your data is just a videoWidth*videoHeight array, then setting
stride
> equal to the width is the correct thing to do.
>
OK... thanks...
> >For the bitrate fields... what happens if i set it to 0 ? Will it do some
> >default action ?
>
> AFAIK encoder_example sets it to 0.
>
> >Also the aspect ratio fields... i am just setting
> >
> >aspect_numerator = videoWidth
> >aspect_denominator = videoHeight
> >
> >Am i correct in doing this ? Any restrictions ?
>
> No, this is incorrect. The aspect ratio is the pixel aspect ratio, not the
> frame aspect ratio. For square pixels, set both values to 1.
>
Aha ! I thought it that was wrong !
> >Also... i'm noticing that most of the filters in directshow output YUY2
and
> >not YUV12... just curious if there is code floating around somewhere to
do
> >the conversion before i write it myself... it doesn't look too complex
> >anyway.
>
> I'm sure ffmpeg or mplayer or some other GPL'd project has code to do
this.
I'd prefer to find something BSD licensed... i might just write it myself.
> One thing to be careful about is the chroma sampling positions, which
often
> differ between 4:2:2 and 4:2:0 formats. Not that you can really tell what
> they're supposed to be from a FOURCC.
>
Yeah... i noticed that when looking around... there's a half pixel offset
depending whether the sampling positions are aligned to the pixels or
aligned between two pixels.
> >Also, looking at some wmv output... (which is a format that outputs
YV12)...
> >it doesn't set a frame rate in the setup header... so i assume this means
> >it's a variable frame rate if such a thing exists ?? Any thoughts on the
> >best way to map a variable frame rate output onto theoras fixed frame
rate ?
>
> As I understand it, a lot of dshow filters don't specify a framerate, even
if
> it _is_ constant and known. Most solutions seem to be of the "ask the user
for
> one" variety.
OK... fair enough....
Thanks very much for your help....
Maybe now i can get it to create something other than a solid pink frame !
:)
Zen.
More information about the Theora-dev
mailing list