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 710149 - [tsdemux] - should allow byte based seeks to go through
[tsdemux] - should allow byte based seeks to go through
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-14 23:49 UTC by Lori Anderson
Modified: 2013-10-16 15:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Lori Anderson 2013-10-14 23:49:21 UTC
When using a source such as souphttpsrc, byte seek requests should result in an updated GET request with a Range header reflecting the requested byte position. When format of content is mpeg2 ts, the tsdemux does not allow the byte seek request to be processed.  If I comment out the following  in mpegtsbase.c - mpegts_base_handle_seek_event()
   if (format != GST_FORMAT_TIME)
     return FALSE;
the HTTP GET request is updated with the appropriate RANGE header value and video plays at the approximate position requested - seek works.
Comment 1 Edward Hervey 2013-10-15 07:12:26 UTC
That's not valid, if a demuxer receives a seek request in BYTES on a source pad, it essentially means "seek to that position in bytes on that pad (i.e. that elementary stream)" and not "seek to that position in bytes in the overall/muxed stream (i.e. upstream)".

If you want to seek to a specific position in bytes in HTTP ... you essentially need to seek on the souphttpsrc element itself (who will then downstream the appropriate segment events).
Comment 2 Sebastian Dröge (slomo) 2013-10-15 07:18:46 UTC
Yes, as Edward said. And implementing seeks in BYTE format on the srcpads properly is rather uninteresting and impossible with mpegts.
Comment 3 Tim-Philipp Müller 2013-10-15 08:20:00 UTC
What is your use case for this? Why do you need it?
Comment 4 Lori Anderson 2013-10-15 12:40:25 UTC
My use case is streaming an mpeg2 ts content item from a server.  I am using playbin.  I am trying to support servers that do not support time based seeks.  I have a simple c program test application which issues a byte based seek.  The event is propagated through the pipeline starting with playbin but before souphttpsrc gets a shot at it, it is rejected by tsdemux.  I can attach my pipeline diagram if that would be useful.
Comment 5 Edward Hervey 2013-10-15 12:43:52 UTC
Then just seek in time, tsdemux should convert that seek event into a BYTE seek event.
Comment 6 Lori Anderson 2013-10-15 12:47:40 UTC
Yes - time based seeks are not an issue but I would like to "honor" the application's request of a byte based seek.  From an application perspective, they feel there is no reason a byte based seek can not be supported - all it takes is a new HTTP GET request with a RANGE header.
Comment 7 Sebastian Dröge (slomo) 2013-10-15 12:57:38 UTC
If you really need that for whatever reason, you can get the source from playbin and send the seek to that. A byte-based seek to tsdemux is not going to do what you expect (if it's implemented, and implemented properly).
Comment 8 Lori Anderson 2013-10-15 13:10:21 UTC
The right way for application developers to deal with this is if they want to do a byte based seek, they get playbin's source element and send the seek event to the source element.  What about time based seeks?  Can they still send directly to playbin or should they get the source element in that case also?
Comment 9 Edward Hervey 2013-10-16 06:58:00 UTC
Can we move this to the gst-devel mailing list ? :)
Comment 10 Lori Anderson 2013-10-16 15:33:43 UTC
I am going to investigate this some more and if I have additional questions or want to discuss this further, I will send to gst-devel mailing list.  Thanks for following up.