PDA

View Full Version : qt5 gstreamer subtitle (closed caption) display



sky
6th May 2014, 12:09
Hi,

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.2 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

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 subtitles showed up correctly.

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?
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