3

How to disable QMediaPlayer autoload subtitles with DirectVobSub which is tools of K-Lite Codec Pack? i don't want to show subtitle in QMediaPlayer if the subtitle file be in same directory of the video file?

hassan deldar
  • 293
  • 1
  • 11
  • 1
    Most likely it is impossible from Qt as this codec is loaded as a DirectShow filter so it happens automatically. It may be possible through Win32 API though. – George Y. Dec 14 '13 at 02:49

2 Answers2

1

Answer

As QMediaPlayer relies on external frameworks for rendering video, it has limited control over how those frameworks decide to render it. In this case, as George Y. mentioned, the subtitles are probably not possible to control without resorting to win32 API.

Another option might be investigating options for controlling which codecs are preferred, and perhaps ship codecs with your application that does not render the subtitles.

Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
1

You have to unset the flag GST_PLAY_FLAG_TEXT on playbin2 in the file qgstreamerplayersession.cpp, build the plugin and use it. The flag is on by default. In Qt 5.2 the you will find the file at qtmultimedia/src/plugins/gstreamer/mediaplayer. The file location may be different for the older 4.x versions.

sky
  • 115
  • 2
  • 10
  • This is valid only on linux-gstreamer env. I just noticed that you are working an win env. – sky May 08 '14 at 09:08