After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 590362 - [v4l2src] x264enc ! qtmux fails because of missing frame duration
[v4l2src] x264enc ! qtmux fails because of missing frame duration
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: 0.10.17
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-31 11:26 UTC by kapil
Modified: 2009-10-14 11:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
Proposed patch (1.38 KB, patch)
2009-10-13 23:44 UTC, Thiago Sousa Santos
reviewed Details | Review

Description kapil 2009-07-31 11:26:43 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:
Comment 1 Thiago Sousa Santos 2009-08-10 18:39:05 UTC
When replacing v4l2src with videotestsrc it works fine. I think v4l2src should set correct duration in its buffers.
Comment 2 Thiago Sousa Santos 2009-10-13 23:44:30 UTC
Created attachment 145388 [details] [review]
Proposed patch

Solve the problem by estimating the buffer durations based on the framerate. (As suggested by Tim)
Comment 3 Tim-Philipp Müller 2009-10-14 08:01:56 UTC
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 :)
Comment 4 Thiago Sousa Santos 2009-10-14 11:03:52 UTC
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?