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 666312 - subparse fails to play subtitle after executing seek() on video
subparse fails to play subtitle after executing seek() on video
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.35
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-15 18:52 UTC by maxphil
Modified: 2013-08-16 11:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Subparse debug output. (9.63 KB, text/plain)
2011-12-15 18:52 UTC, maxphil
Details

Description maxphil 2011-12-15 18:52:18 UTC
Created attachment 203599 [details]
Subparse debug output.

This issue occurs with gstreamer 0.10.35 and subparse 0.10.35.

After playing the video and veryfing that audio/video/subtitles are good, sending a seek() event to the pipeline to change the position of the video makes subparse fail to display the subtitle, while audio and video performs as expected. This behavior seems to be completely random, sometimes the subtitle is displayed after a seek() and sometimes it doesn't.

This issue was initially reported on gstreamer-devel list, there's some extra info/logs in that thread that might be helpful: http://lists.freedesktop.org/archives/gstreamer-devel/2011-December/034306.html

I also noticed that the same problem happens when I try to change the playback rate. I'm using QtGstreamer and this is the code that changes the playback rate:

    QGst::PositionQueryPtr query = QGst::PositionQuery::create(QGst::FormatTime);
    if (!_pipeline->query(query))
    {
        qDebug() "Aborting request!";
        return;
    }

    QGst::SeekEventPtr evt = QGst::SeekEvent::create(_playback_rate,
                                                     QGst::FormatTime,
                                                     QGst::SeekFlagFlush,
                                                     QGst::SeekTypeNone,
                                                     query->position(),
                                                     QGst::SeekTypeNone,
                                                     QGst::ClockTime::None);

    _pipeline->sendEvent(evt);


and the following instructions are used for seek():

    QGst::SeekEventPtr evt = QGst::SeekEvent::create(_playback_rate,
                                                     QGst::FormatTime,
                                                     QGst::SeekFlagFlush,
                                                     QGst::SeekTypeSet,
                                                     QGst::ClockTime::fromTime(QTime().addMSecs(pos)),
                                                     QGst::SeekTypeNone,
                                                     QGst::ClockTime::None);

    _pipeline->sendEvent(evt);
    _pipeline->setState(QGst::StatePlaying);


I thought about writing a minimal application to reproduce this behavior but I figured it would be much easier to test this issue if I found a way to reproduce it in gst-launch. The difficulty was finding a native way to set the video to start at a specific position. I finally found out about gnonlin, so the command below uses the element gnlfilesource to do exactly that:

gst-launch filesrc location=/data/videos/tbbt_s05e01.srt ! subparse ! bot. gnlfilesource location=file:///data/videos/tbbt_s05e01.avi duration=10000000000000 media-start=100000000000 ! ffmpegcolorspace ! textoverlay name=bot valignment=bottom  ! xvimagesink

When the property media-start is set to 0, the video starts playing from the beginning of the file and the subtitle is OK. But if media-start is set to an arbitrary position, like the middle of the file, than the subtitle is not showed anymore.

The fact is that the log (attached) clearly shows that after a seek() operation subparse starts reading the file from the beginning again, to search for the desired timestamp, but after a few seconds it simply gives up searching and there's no indication of why.
Comment 1 Vincent Penquerc'h 2011-12-16 17:47:47 UTC
Do subtitles show up after some delay, possibly up to about a minute ?
Comment 2 maxphil 2011-12-16 18:00:46 UTC
(In reply to comment #1)
> Do subtitles show up after some delay, possibly up to about a minute ?

No, they don't.
Comment 3 maxphil 2011-12-22 13:54:23 UTC
I recently compiled GStreamer for Windows and I notice that this problem doesn't happen on Windows, it's Linux only.
Comment 4 Sebastian Dröge (slomo) 2013-08-16 11:18:53 UTC
Is this still a problem with latest git master?
Comment 5 Sebastian Dröge (slomo) 2013-08-16 11:19:21 UTC
At least I wasn't able to reproduce it here, please reopen if you have a testcase that still reproduces it