Totem uses wrong framerates for streaming video

Bug #172493 reported by Austin Lund
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GStreamer
Fix Released
Low
gstreamer0.10 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: totem

I have been trying to stream video using Totem and the video is very jerky. Take for example:

http://mpegmedia.abc.net.au/tv/enoughrope/vodcast/enoughrope_seinfeld1.wmv

If I download this link and play the file it is fine. Asking it to stream and the video is very jerky.

When playing the downloaded file the framerate is reported to be 25 FPS (which is right).

When streaming the framerate is reported to be 5 FPS (which is wrong).

I am running Gutsy with Totem Movie Player 2.20.0 using GStreamer 0.10.14.

Revision history for this message
Austin Lund (austin-lund) wrote :

Well

gst-launch playbin uri=http://mpegmedia.abc.net.au/tv/enoughrope/vodcast/enoughrope_seinfeld1.wmv

seems to have the same effect.

Revision history for this message
Austin Lund (austin-lund) wrote :

Well I found why it is happening, but I cannot explain it.

In the asfdemux plugin in gstreamer the framerate is set bizarrely if not known. The code from gstasfdemux.c in the gst_asf_demux_process_chunk function shows why 5fps:

...
    if (!stream->fps_known) {
      if (!stream->cache) {
        stream->cache = stream->payload;
      } else {
        gdouble fps;
        gint64 diff;
        gint num, denom;

        /* why is all this needed anyway? (tpm) */
        diff = GST_BUFFER_TIMESTAMP (stream->payload) -
            GST_BUFFER_TIMESTAMP (stream->cache);

        fps = (gdouble) GST_SECOND / diff;

        /* artificial cap */
        if (fps >= 50.0) {
          num = 50;
          denom = 1;
        } else if (fps <= 5.0) {
          num = 5;
          denom = 1;
        } else {
          /* crack alert */
          num = (gint) GST_SECOND;
          while (diff > G_MAXINT) {
            num = num >> 1;
            diff = diff >> 1;
          }
          denom = (gint) diff;
        }
        stream->fps_known = TRUE;
        stream->caps = gst_caps_make_writable (stream->caps);
        gst_caps_set_simple (stream->caps,
            "framerate", GST_TYPE_FRACTION, num, denom, NULL);
        GST_DEBUG ("set up stream with fps %d/%d", num, denom);
        gst_pad_use_fixed_caps (stream->pad);
        gst_pad_set_caps (stream->pad, stream->caps);

        ret = gst_asf_demux_push_buffer (demux, stream, stream->cache);
        stream->cache = NULL;

        ret = gst_asf_demux_push_buffer (demux, stream, stream->payload);
        stream->payload = NULL;
      }
...

So this is a case where it doesn't know the framerate, but sets it anyway, to the wrong value.

As I said above, I cannot explain why this is the case.

Revision history for this message
Austin Lund (austin-lund) wrote :

Can anyone confirm this bug?

Revision history for this message
Austin Lund (austin-lund) wrote :

Well.... no one is out there. The link still works and is up for testing. I tried it on Hardy and the bug is still there.

I just need someone to confirm so I can label as confirmed.

Revision history for this message
Sebastien Bacher (seb128) wrote :

you should open the bug on bugzilla.gnome.org where the people writting the software will read it too

Changed in gstreamer0.10:
importance: Undecided → Low
Revision history for this message
Austin Lund (austin-lund) wrote :

I'm not sure but this seems related to this upstream bug:

http://bugzilla.gnome.org/show_bug.cgi?id=341977

The file in that bug is not around any more, but my file is. I'll see if I can get any attention.

Changed in gstreamer0.10:
status: New → Triaged
Changed in gstreamer:
status: Unknown → Confirmed
Revision history for this message
Austin Lund (austin-lund) wrote :

Still an issue in intrepid.

Revision history for this message
Austin Lund (austin-lund) wrote :

This is possibly fixed in the CVS repo for gstreamer.

http://webcvs.freedesktop.org/gstreamer/gst-plugins-ugly/gst/asfdemux/gstasfdemux.c?revision=1.148&view=markup

Doesn't seem to be in the latest release packages though.

I have not been able to verify if this fixes the issue or not.

Changed in gstreamer:
status: Confirmed → Invalid
Revision history for this message
Austin Lund (austin-lund) wrote :

Can somebody running jaunty confirm this is fixed please?

Revision history for this message
Austin Lund (austin-lund) wrote :

Well. I can confirm it is fixed in 9.04. The link is broken, but here is another one:

http://mpegmedia.abc.net.au/tv/enoughrope/vodcast/enoughrope_stiller.wmv

I get some tearing, but that is clearly another issue.

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Thanks. Closing the bug then.

Changed in gstreamer:
status: Invalid → Unknown
Changed in gstreamer0.10 (Ubuntu):
status: Triaged → Fix Released
Changed in gstreamer:
importance: Unknown → Low
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.