GNOME Bugzilla – Bug 709833
souphttpsrc: Cannot set playspeed !=1 on Mpeg TS played on non-seekable HTTP sources
Last modified: 2014-11-24 10:07:53 UTC
I tried the following cmd with a moded gst-launch to handle a playspeed parameter. ./gst-launch-1.0 -p 2 playbin uri=http://10.1.117.4:61498/mal/I/MY11/146.mpeg ---------------------------------------------------------- Here is the output, the file plays at speed 1 =============================================================================================== This is a moded version of gst-inspect-1.0 to accept a -p %f param and apply it as playspeed. =============================================================================================== Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Redistribute latency... Prerolled, waiting for buffering to finish... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... Setting playspeed to 2.00x (gst-launch-1.0:27468): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed Failed to set playspeed! New clock: GstAudioSinkClock If I download the file with wget and play it trough the filesrc element, the file play at the requested speed. am I missing something, or is there a bug for this kind of media? Mpeg PS file works well... Regards, Eric
Just tried with gst-plugins-base/tests/examples/playback/playback-test and it works fine (no assertion, a slight pause when switching rate, but it does playback at 2x). When do you send the seek request ? What does you seek event look like ?
Oh, and I tested with current git master.
I added a seek after pipeline is set to playing in gst-launch around line 1079 if( playspeed != 1) { PRINT (_("Setting playspeed to %.2fx\n"), playspeed); if( !gst_element_seek(GST_ELEMENT(pipeline),playspeed, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_SNAP_NEAREST, GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE) ) { PRINT(_("Failed to set playspeed!\n")); } } after : PRINT (_("Setting pipeline to PLAYING ...\n")); if (gst_element_set_state (pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { GstMessage *err_msg; GstBus *bus; g_printerr (_("ERROR: pipeline doesn't want to play.\n")); bus = gst_element_get_bus (pipeline); if ((err_msg = gst_bus_poll (bus, GST_MESSAGE_ERROR, 0))) { print_error_message (err_msg); gst_message_unref (err_msg); } gst_object_unref (bus); res = -1; goto end; } playspeed is set via a command arg I added.
if it can help, the audio is AC3
I gave a try to the playback example. And i have the same problem, the seek fails : (lt-playback-test:25039): GStreamer-CRITICAL **: gst_segment_do_seek: assertion `segment->format == format' failed seek failed
here is a link were you can download the file I'm working on : https://www.dropbox.com/s/kxmvq4eb7y04raa/test_mpeg_ts_ac.mpeg
Works fine for me with playback-test and your file
Did you try to read the file trough http?
Yes, my bet is that your seek goes through before the demuxer is added so goes straight to souphttpsrc and triggers some bug there.. But I can't reproduce it.
I think it my be due to the absence of Content-Length in the response header. I tried streaming from an Apache server which adds the Content-Length header in the response, and everything works well. But if the server doesn't give the Content-Length, we are unable to seek or set a play-speed for that media. We don't have the problem with MPEG_PS, even when there is no Content-Length in the response header.
Make sense, souphttpsrc declares the content non-seekable without Content-Length (it assumes it's live content). Which server are you using ?
It's certification tool's server. It doesn't give the content length, so it's ok not being able to seek forward. but we shouldn't we be able to set a play speed and maybe seek back?
If the server doesn't provide a content-length, then souphttpsrc will consider it as non-seekable. So the problem isn't the playspeed, it's just that you won't be able to seek at all. Tempted to close this since it's an issue with the server (and not GStreamer).
Agreed, let's close it. (The server might support seeking DLNA-style in time format, but there are other bugs for that IIRC).