问题
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?
回答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.
回答2:
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.
来源:https://stackoverflow.com/questions/20298580/disable-showing-subtitle-file-in-qmediaplayer