[gst-devel] ffdec_mpeg4 header damaged

Tim Muller t.i.m at zen.co.uk
Fri Jun 15 11:13:15 CEST 2007


Riccardo Corona <coronariccardo at gmail.com> wrote :

> How can I set the duration on the buffer?

For testing purposes, try something like this for timestamps and durations (and get rid of the GstClock/currenttime stuff):

/* framerate (assumed to be fixed) */
#define FPS_NUM 25
#define FPS_DEN 1

static guint frame_num = 0;

GstClockTime ts, next_ts;

ts = gst_util_uint64_scale_int (frame_num * GST_SECOND, FPS_DEN, FPS_NUM);
next_ts = gst_util_uint64_scale_int ((frame_num + 1) * GST_SECOND, FPS_DEN, FPS_NUM);

GST_BUFFER_TIMESTAMP (buf) = ts;
GST_BUFFER_DURATION (buf) = next_ts - ts;

++frame_num;

This assumes a fixed framerate.

 Cheers
  -Tim









More information about the gstreamer-devel mailing list