Disable showing subtitle file in QMediaPlayer

这一生的挚爱 提交于 2019-12-12 14:13:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!