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 555260 - multifilesrc: fix seeking support
multifilesrc: fix seeking support
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-06 16:33 UTC by Jorge
Modified: 2018-11-03 14:38 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
video-info: Fail cleanly if convertion cannot be made (3.41 KB, patch)
2014-05-29 00:43 UTC, Nicolas Dufresne (ndufresne)
none Details | Review
multifilesrc: Fix seeking for the video case (5.49 KB, patch)
2014-05-29 00:44 UTC, Nicolas Dufresne (ndufresne)
none Details | Review
multifilesrc v2: Fix seeking for the video case (5.80 KB, patch)
2014-05-29 04:10 UTC, Nicolas Dufresne (ndufresne)
none Details | Review

Description Jorge 2008-10-06 16:33:52 UTC
I build a pipeline like this:

multifilesrc ! jpegdec ! ffmpegcolorspace !videosink

(where multifilesrc has a "image/jpeg,framerate=15/1" cap for correct playing)

I can make it play/pause/stop, but it won't seek nor allow query for a position. Using from pyhton:

   pos = self.player.pipeline.query_position(gst.FORMAT_DEFAULT, None)[0]

returns the following error:

   gst.QueryError: query failed

And doing 

   self.player.pipeline.seek_simple(gst.FORMAT_DEFAULT, gst.SEEK_FLAG_FLUSH, 3)

does nothing (nor error, nor seeking). From trying stuff it seems as if multifilesrc only respects it's "index" property.
Comment 1 Sebastian Dröge (slomo) 2008-10-08 10:31:00 UTC
You're right, multifilesrc should probably accept seeks and position queries in DEFAULT format.
Comment 2 Wim Taymans 2008-10-08 10:44:21 UTC
Not really interesting but here's a start:

        * gst/multifile/gstmultifilesrc.c: (gst_multi_file_src_class_init),
        (gst_multi_file_src_query):
        Implement DEFAULT and BUFFER position queries. See #555260.

For proper position querying that works over queues, jpegdec or videosink
should convert the time to buffers (or query upstream to convert time to
buffers first).
Comment 3 Tim-Philipp Müller 2009-08-01 19:36:37 UTC
Marking as enhancement. Anything else that needs to be done in multifilesrc - if so what? I'm not really sure how this should work / what the semantics should be like?
Comment 4 Jorge 2009-08-01 20:31:39 UTC
When i reported this i was trying to do a stop-motion application. I had a sequence of jpgs, captured with a webcam, and wanted to visualize the animation (each jpg a frame). From there the semantics would be the usual. The seek was to be used for stepping trough the animation frame by frame, or looping a few frames to check the flow (forwards and backwards). That kind of stuff.
Comment 5 Nicolas Dufresne (ndufresne) 2014-05-22 00:43:38 UTC
Ok this subject is getting resurected by GES folks, Wim, I think the position query implemented with DEFAULT will not work well if you have jpeg file containing multiple jpegs (and not always that same amount).

Can't we just implement this in bytes like other sources ? If we have a stop index, we can just stats and populate an index.
Comment 6 Thibault Saunier 2014-05-23 07:58:34 UTC
The seeking part has been merged as part of: https://bugzilla.gnome.org/show_bug.cgi?id=712254

I do not think the position query is handled though.
Comment 7 Nicolas Dufresne (ndufresne) 2014-05-23 14:08:14 UTC
(In reply to comment #6)
> The seeking part has been merged as part of:
> https://bugzilla.gnome.org/show_bug.cgi?id=712254
> 
> I do not think the position query is handled though.

Ok, but seek does not work cause we don't handle the format:

basesrc gstbasesrc.c:1394:gst_base_src_default_prepare_seek_segment:<multifilesrc0> undefined format given, seek aborted.
Comment 8 Nicolas Dufresne (ndufresne) 2014-05-29 00:43:34 UTC
Created attachment 277424 [details] [review]
video-info: Fail cleanly if convertion cannot be made

This allow using video-info format converter with non raw formats like image/jpeg.
Comment 9 Nicolas Dufresne (ndufresne) 2014-05-29 00:44:06 UTC
Created attachment 277425 [details] [review]
multifilesrc: Fix seeking for the video case

This fixes seeking for the video case
Comment 10 Nicolas Dufresne (ndufresne) 2014-05-29 04:10:24 UTC
Created attachment 277428 [details] [review]
multifilesrc v2: Fix seeking for the video case

If fixed a warning of use, uninitialized, also fixed the duration query, to set -1 instead of failing if position cannot be known.

I didn't know it existed, but I think it would be good to implement prepare_seek_segment(), as we can seek in multiple format depending on the caps, not just time. I also notice that start/stop should be implemented, so we can clear the state when stopped. I'd like some input on that.
Comment 11 Tim-Philipp Müller 2014-05-29 09:21:05 UTC
Now we're adding video-specific code to multifilesrc? Not convinced that's great, perhaps we should just wait for that imagesequencewhateversrc instead?
Comment 12 Nicolas Dufresne (ndufresne) 2014-05-29 12:42:45 UTC
(In reply to comment #11)
> Now we're adding video-specific code to multifilesrc? Not convinced that's
> great, perhaps we should just wait for that imagesequencewhateversrc instead?

Right, I was just trying to fix something that was there. So my reflection was more like, let's fix it, and we can do the same with audio later. The fact is that imagesequencesrc would need to re-implemented everything as it is. As for playback (outside playing from start to end) multifilesrc is pretty useless.

I'm still seeking for input on the other proposed solution. Would it be possible to implement seeking the same way other filesrc do ?
Comment 13 Nicolas Dufresne (ndufresne) 2014-11-22 21:29:11 UTC
So I suppose this is a dead end, may I close/reject this ?
Comment 14 GStreamer system administrator 2018-11-03 14:38:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/8.