GNOME Bugzilla – Bug 590362
[v4l2src] x264enc ! qtmux fails because of missing frame duration
Last modified: 2009-10-14 11:30:17 UTC
Please describe the problem: gst-launch-0.10 v4l2src ! x264enc ! qtmux ! fakesink -v gives error, Failed to determine time to mux. But, gst-launch-0.10 v4l2src ! videorate ! x264enc ! qtmux ! fakesink -v works. Since x264enc doesnt output right duration incase the framerate is not appropriate. qtmux expects right duration for it to work. Steps to reproduce: 1. gst-launch-0.10 v4l2src ! x264enc ! qtmux ! fakesink -v Actual results: Failed to determine time to mux. Expected results: x264enc should output correct duration Does this happen every time? yes Other information:
When replacing v4l2src with videotestsrc it works fine. I think v4l2src should set correct duration in its buffers.
Created attachment 145388 [details] [review] Proposed patch Solve the problem by estimating the buffer durations based on the framerate. (As suggested by Tim)
Comment on attachment 145388 [details] [review] Proposed patch Some minor nitpicks: >From: Thiago Sousa Santos <thiagoss@darkwater.(none)> You should set up a proper e-mail address, see the GitDevelopersGuide wiki page for details (somewhere at the end). >@@ -938,11 +940,15 @@ gst_v4l2src_create (GstPushSrc * src, GstBuffer ** buf) > timestamp -= latency; > else > timestamp = 0; >+ >+ /* estimate duration from framerate */ >+ duration = (GST_SECOND * v4l2src->fps_d) / v4l2src->fps_n; > } > } We usually use utility functions like gst_util_uint64_scale_int() for these kind of calculations to avoid overflows (see a few lines above). Not it's likely to matter much here, but still. Also, in this case a duration = latency would probably suffice :)
Fixed by: Module: gst-plugins-good Branch: master Commit: 72af90ae31907964b31c368164ec17d0f72aa7bf URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=72af90ae31907964b31c368164ec17d0f72aa7bf Author: Thiago Santos <thiagoss@embedded.ufcg.edu.br> Date: Wed Oct 14 07:38:26 2009 -0300 Can someone please close this?