[gst-devel] Real video framerate differs of given pipeline framerate

Albert Costa costa_albert at yahoo.fr
Fri Sep 18 16:18:40 CEST 2009

Dear All,
I have a question about usage of usb webcam. My pipeline is as follow:

gst-launch-0.10.exe ksvideosrc ! ffmpegcolorspace ! videorate ! video/x-raw-yuv,width=640,framerate=30/1 ! ffmpegcolorspace ! clockoverlay ! ffmpegcolorspace ! ffenc_mpeg2video gop-size=1 quantizer=4 ! ffmux_mpegts ! filesink location=c:\\web.ts sync=false

It connects to a webcam, overlays the clock, encode to mpeg ts format and save it to file. When I read the file, I can see that the frame timestamps are not in sync with reality for a bunch of seconds. I mean that the duration of a frame does not correspond to the "real" time elapsed (frame duration is set to 33ms, but in the real life maybe 43ms have been gone since last buffer was sent). This happens for about the 50 first frames. So playing the file afterwards makes the first frames be displayed faster than it should be (I use external player that bases himself on given framerate).
No matter what I've tried (setting sync to 0/1, using or not videorate...) I always have this lag (because of camera init I guess). 
How can I ensure that the frames are generated at the real framerate? or how can I discard the frames that do not match the framerate?
Best Regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090918/414cdd9f/attachment.htm>

More information about the gstreamer-devel mailing list