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 597497 - can't play a redirecting .mov file via playbin
can't play a redirecting .mov file via playbin
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: 0.10.18
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-06 01:59 UTC by Matthew Fulmer
Modified: 2010-01-15 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The offending mov file (1.62 KB, video/quicktime)
2009-10-06 01:59 UTC, Matthew Fulmer
  Details
Straightforward solution patch (6.48 KB, patch)
2009-10-15 13:35 UTC, Thiago Sousa Santos
none Details | Review
Reviewed patch (7.52 KB, patch)
2009-10-19 18:57 UTC, Thiago Sousa Santos
rejected Details | Review

Description Matthew Fulmer 2009-10-06 01:59:55 UTC
Created attachment 144865 [details]
The offending mov file

%  gst-launch-0.10 -v playbin
uri='http://www.adventurefree.tv/unicast_mov/AFTVAdventureH264250.mov'
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src:
caps = video/quicktime
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0.GstPad:sink:
caps = video/quicktime
ERROR: from element /GstPlayBin:playbin0: You do not have a decoder installed
to handle this file. You might need to install the necessary plugins.
Additional debug info:
gstplaybasebin.c(2327): prepare_output (): /GstPlayBin:playbin0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0.GstPad:sink:
caps = NULL
/GstPlayBin:playbin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src:
caps = NULL
Freeing pipeline ...

Attached is the file that playbin downloaded
Comment 1 Michael Smith 2009-10-06 02:03:00 UTC
The mov file here is a quicktime-redirector file to an rtsp stream. Directly playing the stream works fine.

So, we should be sending a redirect message instead of a missing-decoder message.
Comment 2 Thiago Sousa Santos 2009-10-06 14:34:25 UTC
It already detected that it is an rtsp stream and ignores it (line 3519 of qtdemux.c).

When we only have a single track with rtsp we can just post a redirect message, but what to do when there are multiple tracks and one of them is rtsp?
Comment 3 Sebastian Dröge (slomo) 2009-10-08 11:43:09 UTC
Implementing the single-track case should be done IMHO, for multi track files rtsp URIs should still be ignored. That should fix most cases I guess.

And if someone really needs it for multi-track files it becomes complex (maybe can be done by internally having rtspsrc's inside qtdemux)
Comment 4 Thiago Sousa Santos 2009-10-14 19:05:57 UTC
One option is to have a signal/message/any other notification mechanism to tell the application that the stream is part of the media.
Comment 5 Thiago Sousa Santos 2009-10-14 19:55:26 UTC
It seems the problem is different here. It is already posting a redirect message, but the new-location field is "" (empty). This .mov has the rtsp address inside dref atom, which is currently not handled by qtdemux.
Comment 6 Thiago Sousa Santos 2009-10-15 13:35:28 UTC
Created attachment 145519 [details] [review]
Straightforward solution patch

This code to fetch the uri from inside the atoms is really painful, if anyone out there got an easier way/idea on how to do it, please tell and I'll implement it.
Comment 7 Thiago Sousa Santos 2009-10-15 13:36:32 UTC
Aditionally qtdemux is now posting 2 redirect messages, the one introduced by the patch (the correct one with the correct URI) and another one containing an empty string.
Comment 8 Tim-Philipp Müller 2009-10-15 14:31:04 UTC
Not really familiar with how this all fits together, but here are some random comments nevertheless:

 - could this be split out into a separate function? I think
   parse_trak() is already quite long

 - it looks like you're assuming that the URI string is
   NUL-terminated, which you shouldn't. Better 
   g_strndup() and then later g_free() the string to
   make absolutely sure it has a terminator.

 - might want to check that the URI is a valid uri
   and/or looks like what you're looking for (do
   we only want URIs that redirect to rtsp://... ?)

 - how does this work policy-wise with these URIs?
   Do they sometimes appear in perfectly valid
   and playable files as extra information on the
   side (in which case the app shouldn't act on the
   redirect message) or can we assume that if
   there is such a redirect that's it? I don't really
   know what we do now, but we probably should
   think about this. Currently totem acts immediately
   on a redirect message, IIRC.

 - if there are multiple URIs, should they be collected
   and posted in one single message? (like the other
   redirect code does)

 - does that 4-byte value that you skip make sense
   if interpreted as bitrate?
Comment 9 Thiago Sousa Santos 2009-10-16 11:27:09 UTC
(In reply to comment #8)
> Not really familiar with how this all fits together, but here are some random
> comments nevertheless:
> 
>  - could this be split out into a separate function? I think
>    parse_trak() is already quite long
Agreed.

> 
>  - it looks like you're assuming that the URI string is
>    NUL-terminated, which you shouldn't. Better 
>    g_strndup() and then later g_free() the string to
>    make absolutely sure it has a terminator.
Alright.

> 
>  - might want to check that the URI is a valid uri
>    and/or looks like what you're looking for (do
>    we only want URIs that redirect to rtsp://... ?)
In this case, the trak type is 'rtsp', so I guess we can check if it starts with 'rtsp'

> 
>  - how does this work policy-wise with these URIs?
>    Do they sometimes appear in perfectly valid
>    and playable files as extra information on the
>    side (in which case the app shouldn't act on the
>    redirect message) or can we assume that if
>    there is such a redirect that's it? I don't really
>    know what we do now, but we probably should
>    think about this. Currently totem acts immediately
>    on a redirect message, IIRC.
This is on a trak, so there is nothing restricting it on
appearing with other 'normal' traks, or having multiple
rtsp traks together. I guess we should have a different message
to signal this. Something like an 'external-location' or 'external-content'.

> 
>  - if there are multiple URIs, should they be collected
>    and posted in one single message? (like the other
>    redirect code does)
Already answered.

> 
>  - does that 4-byte value that you skip make sense
>    if interpreted as bitrate?
Don't know, it is all zeroes in this sample.


I had never seen files like this before, but quicktime plays it fine. (Well, the rtsp seems to
be inaccessible/down right now, but it does a redirect).
Comment 10 Thiago Sousa Santos 2009-10-19 18:57:17 UTC
Created attachment 145801 [details] [review]
Reviewed patch

Improved patch. It posts a redirect if the file contains only one trak, and if it is a rtsp trak.
Comment 11 Thiago Sousa Santos 2010-01-15 16:50:51 UTC
Module: gst-plugins-good
Branch: master
Commit: 92a83e016aa0824549a8e913f8bfa8ee105b0a44
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=92a83e016aa0824549a8e913f8bfa8ee105b0a44

Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk>
Date:   Thu Jan 14 17:11:13 2010 -0300

qtdemux: Handle another kind of redirect trak

Some traks might contain a redirect rtsp uri inside
hndl atom (which is a dref atom entry). This commit makes qtdemux
post a message when it finds one of these traks and there are
no other traks.

Fixes #597497
Comment 12 Thiago Sousa Santos 2010-01-15 16:51:34 UTC
Comment on attachment 145801 [details] [review]
Reviewed patch

Did not apply anymore,  committed a reviewed/updated version