[MPlayer-dev-eng] mp4, vfr and timestamps

Tomas Carnecky tom at dbservice.com
Thu Jun 15 23:31:38 CEST 2006


Michael Niedermayer wrote:
> the dts and pts ehm i mean cts dont match at all, this file is as expected
> IMO invalid
> 

This is the relevant code from x264:

int set_eop_mp4( hnd_t handle, x264_picture_t *p_picture )
{
    mp4_t *p_mp4 = (mp4_t *)handle;

    uint64_t dts = (uint64_t)p_mp4->i_numframe * p_mp4->i_time_inc;
    uint64_t pts = (uint64_t)p_picture->i_pts;
    int32_t offset = p_mp4->i_init_delay + pts - dts;

    p_mp4->p_sample->DTS = dts;
    p_mp4->p_sample->CTS_Offset = offset;

    gf_isom_add_sample(p_mp4->p_file, p_mp4->i_track, p_mp4->i_descidx,
p_mp4->p_sample);

    return 0;
}

i_time_inc == den == 1 (I have num/den 10000/1)

As you can see, dts is increased in single steps and the offset is the
offset from the real timestamp to dts.

because in the normal x264 source, it sets 'p_picture->i_pts' to
'numframe * den', and thus offset is always zero, I set my own pts and
my offsets are non-zero.
Who is wrong here, gpac, x264 or mplayer? Is offset always supposed to
be zero?

tom



More information about the MPlayer-dev-eng mailing list