qt5.2 gstreamer subtitle display

Luis de Bethencourt luis at debethencourt.com
Tue May 6 13:00:35 PDT 2014


On 6 May 2014 06:29, sky2 <skyqute at gmail.com> wrote:

> Hi Everybody,
>
>   I developed a large application in Qt 4.8.4 on linux mint 14 which simply
> put displays a playlist of videos. Now I am trying to port it to Qt 5.2.
> All
> works well except for the subtitle (closed captioning) display.
>
> In Qt 4.8.4 I used the phonon player with phonon backend
> phonon_gstreamer.so. The subtitles used to be placed in a file video.srt
> (for video.mp4) in the same directory.
>
> In qt5.2 built with GStreamer-0.10, the subitles (closed captions) are just
> not displayed when the video is played.
>
> I went over the code of both Qt5.3 gstreamer plugin and qt 4.8.4 gstreamer
> plugin and found very little difference.
>
> Both of them seem to set the flag GST_PLAY_TEXT (0x00000004).
>
> Both of them seem to set the flag GST_PLAY_FLAG_NATIVE_VIDEO (0x00000040)
>
> Both of them seem to use playbin2
>
> Neither of them seem to set the property "suburi" on playbin2
>
>
The only situation where you don't need to set suburi is when the subtitles
are encoded in the same file. Like in a matroska container.

If that isn't the case, playbin2 needs to know where the subtitle file is.


> In Qt5.2, I changed the plugin code to, 1. set the "suburi" on playbin2 to
> point to the subtitles file video.srt and 2. Made it to ignore (unset) the
> flag GST_PLAY_FLAG_NATIVE_VIDEO (both in the file
> qgstreamerplayersession.cpp )
>
> Then the subtitle started being shown correctly.
>

The flag to only allow native video format should be 0 by default, and you
should keep it that way in your case.


>
> I want to know what is causing this change in behavior of the plugin? Is it
> a bug in Qt5.2? How should I work around it? Should I set the "suburi"
> property on playbin2 in the plugin?
>

I doubt the problem is in QT since the subtitles are mixed inside GStreamer
and displayed in the same sink.

Can you leave the FLAG_NATIVE_VIDEO as it is by default, check and let me
know?

Luis


>
> If that is so then it is very difficult. As it is a plugin, I need to build
> a whole mechanism to pass the subtitle(closed caption) filename to the
> plugin so that I can set the suburi property on playbin2. Thank you. Any
> help is appreciated.
>
> Sky
>
>
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/qt5-2-gstreamer-subtitle-display-tp4666762.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140506/6cb08769/attachment.html>


More information about the gstreamer-devel mailing list