[x264-devel] i_timebase_xxx and libx264

Jason Garrett-Glaser darkshikari at gmail.com
Sun Apr 4 03:10:50 CEST 2010


On Sat, Apr 3, 2010 at 4:33 PM, Takashi Mochizuki
<mochi at da2.so-net.ne.jp> wrote:
> Hi,
> I have some question about timecode handling, using libx264.
>
> 1) r1510's x264.c shows:
> 1185     if( !b_user_fps )
> 1186     {
> 1187         param->i_fps_num = info.fps_num;
> 1188         param->i_fps_den = info.fps_den;
> 1189     }
> 1190     if( param->b_vfr_input )
> 1191     {
> 1192         param->i_timebase_num = info.timebase_num;
> 1193         param->i_timebase_den = info.timebase_den;
> 1194     }
> 1195     else
> 1196     {
> 1197         param->i_timebase_num = param->i_fps_den;
> 1198         param->i_timebase_den = param->i_fps_num;
> 1199     }
>
> at 1197, den goes num, num goes den, is this correct?

Yes.  For a constant framerate source where pts(frame N) = pts(frame
N-1) + 1, the timebase is the inverse of the framerate.

> 2) From apps' point of view which uses libx264 directly, what is the requirement to use VFR?
> I can pass strict pts value of every source frame.
>
> - set param->b_vfr_input to 1
> - set param->i_timebase_num/den to stream timebase value
> - set frame's pts value based on i_timebase_xxx values
>
> Any other requirement is there?

Nope, that's all you need to do.  You should generally set the
framerate to something sane, but that's not strictly required.  With
the latest x264, ratecontrol will take into account your pts and Do
The Right Thing.

Dark Shikari


More information about the x264-devel mailing list