Subtitle is not displayed after executing seek on a video

Karl Phillip maxphil at gmail.com
Thu Dec 15 05:28:57 PST 2011


Just to add some info, I'm sharing the subparse log below with some
comments and I'm actually using gstreamer 0.10.27 (i said 0.10.26 earlier).

I thought this issue could be a known bug that was already solved, so I
compiled the newest subparse from 0.10.35 (doing some hacks to make it
happen) and replaced /usr/lib/gstreamer-0.10/libgstsubparse.so , but it
didn't made any difference, the problematic behavior remained the same.

The log describes the entire execution of my application, including
preparation of the pipeline, the execution of play() (subtitles are
displayed correctly at this stage), then a seek() operation that fails
displaying the subtitles, and some time after that the application is
closed (by me).

If anyone is wondering, the seek is operation is:

    QGst::SeekEventPtr evt = QGst::SeekEvent::create(1.0,
                                                     QGst::FormatTime,
                                                     QGst::SeekFlagFlush,
                                                     QGst::SeekTypeSet,

QGst::ClockTime::fromTime(QTime().addMSecs(pos)),
                                                     QGst::SeekTypeNone,

QGst::ClockTime::None);

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

It's important to state that this seek operation jumps to the middle of the
video. The video is displayed and is playing correctly, but the subtitles
stop being displayed after the seek.

Now, looking at the logs, it seems that a seek() operation makes subparse
goes back to the beginning of the file and start reading everything again
until it finds the correct timestamp. Well, It makes a lot sense. However,
in this specific case, when seek() is executed you can see that it starts
reading the beginning of file, but it reads only the first 4 seconds of
subtitles and then stops. Why?!? Something weird happened and it gave up on
trying to locate the right timestamp, and that explains why the subtitles
are not being displayed after seek. But why it's doing that, I don't know.

Any hints?


/*********** Setting up the pipelines and stuff  ***********/

Qml debugging is enabled. Only use this in a safe environment!

0:00:00.122490350  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1596:gst_sub_parse_sink_event: Handling newsegment event
0:00:00.122603733  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1629:gst_sub_parse_sink_event:<subparse0> newsegment (bytes)
0:00:00.122639642  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1577:gst_sub_parse_chain:<subparse0> pushing newsegment event
with time segment start=0:00:00.000000000, stop=99:99:99.999999999,
last_stop=0:00:00.000000000, duration=99:99:99.999999999, rate=1.000000,
applied_rate=1.000000, flags=0x00, time=0:00:00.000000000,
accum=0:00:00.000000000
0:00:00.122707055  7803  0x8ab5718 INFO                subparse
gstsubparse.c:1432:feed_textbuf: discontinuity
0:00:00.122724213  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1189:parser_state_init: initialising parser
0:00:00.122743281  7803  0x8ab5718 INFO                subparse
gstsubparse.c:522:convert_encoding:<subparse0> invalid UTF-8!
0:00:00.123075214  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:552:convert_encoding:<subparse0> successfully converted 4096
characters from ISO-8859-15 to UTF-8
0:00:00.123218977  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1310:gst_sub_parse_data_format_autodetect: SubRip (time
based) format detected
0:00:00.123241639  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1189:parser_state_init: initialising parser
0:00:00.123372004  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '1'
0:00:00.123411001  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '00:00:00,000 -->
00:00:01,800'
0:00:00.123430946  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:00,000'
0:00:00.123448229  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:01,800'
0:00:00.123467232  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'Anteriormente'
0:00:00.123486224  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'em The Big Bang
Theory.'
0:00:00.123503467  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line ''
0:00:00.123661913  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1544:handle_buffer:<subparse0> Sending text 'Anteriormente
em The Big Bang Theory.', 0:00:00.000000000 + 0:00:01.800000000
0:00:00.123855049  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '2'
0:00:00.123983069  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '00:00:01,801 -->
00:00:04,752'
0:00:00.124003580  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:01,801'
0:00:00.124021034  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:04,752'
0:00:00.124040382  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'Meu irmão tem
uma queda pela Bernadette.'
0:00:00.124059530  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line ''
0:00:00.124088542  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1544:handle_buffer:<subparse0> Sending text 'Meu irmão tem
uma queda pela Bernadette.', 0:00:01.801000000 + 0:00:02.951000000

/*********** Executing play()  ***********/

0:00:02.364775676  7803  0x85cf2e8 DEBUG               subparse
gstsubparse.c:304:gst_sub_parse_src_event: Handling latency event

0:00:04.195769401  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'RMVB por
RoDoLFo™ www.rpds-download.net'
0:00:04.195833281  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line ''
0:00:04.195867626  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '3'
0:00:04.195901080  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '00:00:06,306 -->
00:00:08,848'
0:00:04.195934403  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:06,306'
0:00:04.195965952  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:08,848'
0:00:04.195999530  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'Você está
voltando'
0:00:04.196032207  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'para a Índia?'
0:00:04.196062282  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line ''
0:00:04.196111339  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1544:handle_buffer:<subparse0> Sending text 'Você está
voltando
para a Índia?', 0:00:06.306000000 + 0:00:02.542000000

/*********** Seeking to position 394569ms   ***********/

0:00:06.841279699  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1557:handle_buffer:<subparse0> flow: wrong-state
0:00:06.844613646  7803  0x85cf2e8 DEBUG               subparse
gstsubparse.c:304:gst_sub_parse_src_event: Handling seek event
0:00:06.844724868  7803  0x85cf2e8 DEBUG               subparse
gstsubparse.c:1596:gst_sub_parse_sink_event: Handling flush-start event
0:00:06.844776056  7803  0x85cf2e8 DEBUG               subparse
gstsubparse.c:1596:gst_sub_parse_sink_event: Handling flush-stop event
0:00:06.844854562  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1596:gst_sub_parse_sink_event: Handling newsegment event
0:00:06.844880812  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1629:gst_sub_parse_sink_event:<subparse0> newsegment (bytes)
0:00:06.844903098  7803  0x8ab5718 INFO                subparse
gstsubparse.c:1432:feed_textbuf: discontinuity
0:00:06.844918176  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1189:parser_state_init: initialising parser
0:00:06.844996015  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:552:convert_encoding:<subparse0> successfully converted 4096
characters from ISO-8859-15 to UTF-8
0:00:06.845023413  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '1'
0:00:06.845047112  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '00:00:00,000 -->
00:00:01,800'
0:00:06.845066045  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:00,000'
0:00:06.845083844  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:01,800'
0:00:06.845102641  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'Anteriormente'
0:00:06.845120601  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'em The Big Bang
Theory.'
0:00:06.845137598  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line ''
0:00:06.845168811  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1544:handle_buffer:<subparse0> Sending text 'Anteriormente
em The Big Bang Theory.', 0:00:00.000000000 + 0:00:01.800000000
0:00:06.845198951  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '2'
0:00:06.845219848  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line '00:00:01,801 -->
00:00:04,752'
0:00:06.845237658  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:01,801'
0:00:06.845254871  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:900:parse_subrip_time: parsing timestamp '00:00:04,752'
0:00:06.845273878  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line 'Meu irmão tem
uma queda pela Bernadette.'
0:00:06.845292715  7803  0x8ab5718 LOG                 subparse
gstsubparse.c:1510:handle_buffer:<subparse0> Parsing line ''
0:00:06.845319607  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1544:handle_buffer:<subparse0> Sending text 'Meu irmão tem
uma queda pela Bernadette.', 0:00:01.801000000 + 0:00:02.951000000
0:00:06.845360023  7803  0x85cf2e8 DEBUG               subparse
gstsubparse.c:336:gst_sub_parse_src_event:<subparse0> segment after seek:
time segment start=0:06:34.569000000, stop=99:99:99.999999999,
last_stop=0:06:34.569000000, duration=99:99:99.999999999, rate=1.000000,
applied_rate=1.000000, flags=0x01, time=0:06:34.569000000,
accum=0:00:00.000000000
QML: GOT RESUMED!
0:00:06.850018891  7803 0xad174558 DEBUG               subparse
gstsubparse.c:304:gst_sub_parse_src_event: Handling latency event


/*********** Closing the app   ***********/

0:00:16.608715198  7803  0x8ab5718 DEBUG               subparse
gstsubparse.c:1557:handle_buffer:<subparse0> flow: wrong-state
0:00:16.619552264  7803  0x85cf2e8 DEBUG               subparse
gstsubparse.c:143:gst_sub_parse_dispose:<subparse0> cleaning up subtitle
parser



Thanks,
--
Karl Phillip




On Wed, Dec 14, 2011 at 11:48 PM, Karl Phillip <maxphil at gmail.com> wrote:

> Hello experts,
>
> I'm using QtGstreamer (gstreamer 0.10.26), and before I write a minimal
> application to reproduce the problem I'm facing I would like to ask this in
> case someone has seen it before: I'm using subparse and textoverlay to
> display a (.srt) subtitle over the video and it works great... until seek
> is executed to change the position of the video. Most of the times the
> subtitle disappears, and sometimes after a few seek operations it comes
> back, synced with the video, but executing another seek makes it vanish.
>
> Is there anything obvious I might be missing? Is this a known issue?
>
> Thanks,
> --
> Karl Phillip
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111215/92a9e554/attachment-0001.htm>


More information about the gstreamer-devel mailing list