Answer the question
In order to leave comments, you need to log in
How to change the playing audio track and subtitles in a video in Qt/PyQt/PySide?
I'm using the latest PySide, but I have experience with Qt/C++, so the language is not important.
I do it like this:
app = QApplication()
video_widget = QVideoWidget()
video_widget.resize(800, 600)
video_widget.show()
player = QMediaPlayer()
player.setMedia(QUrl.fromLocalFile(r'video.mp4'))
player.setVideoOutput(video_widget)
player.setVolume(50)
player.play()
sys.exit(app.exec_())
service = player.service()
mscontrol = service.requestControl("org.qt-project.qt.mediastreamscontrol/5.0")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question