GNOME Bugzilla – Bug 694369
tsdemux: unable to change play speed via seek event
Last modified: 2013-07-24 14:34:20 UTC
Created attachment 237056 [details] Tutorial code with modifications to use local file and switch b/w 0.10 & 1.0 I have recently upgraded from GStreamer-0.10 to GStreamer-1.0. I'm working on playspeed support related to mpeg-ts. I started with the GStreamer playspeed tutorial - "Basic tutorial 13: Playback speed" (http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+13%3A+Playback+speed). This tutorial works with GStreamer 0.10 using clock.mpg (see attachment) but does not work with GStreamer 1.0. This tutorial seems to work with GStreamer-1.0 using *.mkv and *.ogv files. The tutorial fails when attempting to do rate change from 1x to 2x under GStreamer-1.0. I get the following error: (basic-tutorial-13:3117): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed There is this note on the tutorial's web page - "Changing the playback rate might only work with local files". I modified the tutorial code as suggested to use a local file (which is attached to this bug - clock.mpg). I also added a #define GSTREAMER_1 to the tutorial *.c code to support changes between GStreamer-0.10 and GStreamer-1.0. I have attached a log with some debugging messages (fail_log.txt). It appears it might be a problem in bad plugin - mpegtsdemux - tsdemux.c. I used the following command to compile (switching between 0.10 and 1.0 as appropriate and also uncommenting #define GSTREAMER_1 in *.c file): gcc basic-tutorial-13.c -o basic-tutorial-13 `pkg-config --cflags --libs gstreamer-[0.10 or 1.0]` I'm running on Ubuntu 12.04 and using last release of GStreamer-0.10 and latest release of GStreamer-1.0.5. I've attached the basic_tutorial.c code from the tutorial with the modification to use local file rather than URL and also #define GSTREAMER_1 to support switching between 0.10 and 1.0.
Created attachment 237058 [details] Log file from run showing error related to seek event
Can't attach the clock.mpg, too big. I'll find a link to sample mpeg-ts which demonstrates same issue.
You can download the Park Run 1280x1080 clip from http://www.w6rz.net/. Modify basic-tutorial-13.c to use your local file.
I have a patch which fixes this issue. This patch includes a workaround to what looks to be a problem in gst_segment_do_seek() where the format field is not updated.
Created attachment 241605 [details] [review] Proposed patch to fix playspeed issue with pushsrc
This looks very similar to issues fixed in bug #701141
I'll take a look at the fixes and update this issue accordingly. Thanks for the post.
I sync'd up with latest and ran tutorial program. I am able to change playspeeds in the forward direction (2,4,8 etc.) without any patches (including mine). Unfortunately changing playspeed direction (reverse playspeeds) still does not work. I did get the code associated with Bug #701141. It did not seem to help, in fact it has unable to changed playspeed from 1x to 2x.
Typo in above comment - "it has unable" should be "it was unable"
Ok, closing this bug then (you can change the playspeed). We never supported reverse playback for mpeg-ts as far as I know.
I am re-opening this bug. With the latest code this no longer works. The issue appears to be in tsdemux.c. I have attached a patch which allows playspeed changing to work. The patch identifies two areas which have changed and has code which allows the playspeed changing to work. I am not suggesting the patch is the proper solution, it just demonstrates which the code supports playspeed changing and what changes prevent it.
Created attachment 250040 [details] [review] Patch which show changes with allow or prevent playspeed changing
Ah right, yes, we need to remember at least the rate.
Created attachment 250041 [details] [review] tsdemux: Remember requested seek rate and use it The new seek handling re-creates the segment time information once it has enough information after a seek. The problem was that we'd completely ignore the requested rate. So store that and use it in the newly created segment.
Does that patch fix your issue (for forward rates) ?
Yes - the patch fixes the playspeed issue for forward rates. Thank you.
commit 1f7fa9be1d5fb619c29fd734c97bbed9c0ea5f36 Author: Edward Hervey <edward@collabora.com> Date: Wed Jul 24 15:50:14 2013 +0200 tsdemux: Remember requested seek rate and use it The new seek handling re-creates the segment time information once it has enough information after a seek. The problem was that we'd completely ignore the requested rate. So store that and use it in the newly created segment. https://bugzilla.gnome.org/show_bug.cgi?id=694369