[x264-devel] Re: Problems with PTS and b frames

Loren Merritt lorenm at u.washington.edu
Wed Dec 14 12:56:02 CET 2005


On Tue, 13 Dec 2005, Bill May wrote:

> First problem: I specify 2 (or more) b frames in param.i_bframe, and
> only 1 b frame occurs.  I'm using X264_TYPE_AUTO in pic_input.i_type,
> except when I want an IDR frame.  Am I missing a variable that would
> need to be set ?

x264 uses only as many B-frames as it thinks are useful. If you think you 
know better, you can hint it with i_bframe_bias or force it with 
b_bframe_adaptive=0. But if you don't have a good reason, that will 
probably only reduce quality.

On Wed, 14 Dec 2005, Laurent Aimar wrote:

>> ts    saved   i_pts   type
>> 0     (0 nals returned)
>> 33    (0 nals returned)
>> 66    (0 nals returned
>> 99     0       0    IDR
>> 122    33      66   P
>> 155    66      33   B
>> 188    99      122  P
>> 221    122     99   B
> x264 returns reordered input pts. You need to add an offset
> to be able to use them. This offset is equal to
> max_reorder_buffer_size * maximum_delay_between_frame.
>
> In case you are not using pyramidal B frame :
> max_reorder_buffer_size equals 1 (0 without B frames).
> maximum_delay_between_frame has to be greater or equal to 1/min_frame_rate
> (becarefull, for example, with realtime PAL acquisition you may not always
> get exact 25fps, sometime a bit lower or higher)
>
> In your case this gives 33ms and (0,66,33,..) + 33 gives what you want.

I would subtract from dts instead. If you're going to use pts for A-V 
sync, at least.

  ts  dts   pts   type
   0
  33
  66
  99  -33     0   IDR
122    0    66   P
155   33    33   B
188   66   122   P
221   99    99   B

--Loren Merritt

-- 
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html



More information about the x264-devel mailing list