Details
Description
Trying to get a basic QMediaPlayer (video player) implementation to work. Program crashes when setting video source for the QMediaPlayer. Tried both QVideoWidget and QGraphicsVideoItem and both crash when implementing the player.setVideoSource() line
Code in the main function shown below:
if __name__ == '__main__': app = QApplication(sys.argv) player = QMediaPlayer() playlist = QMediaPlaylist(player) playlist.addMedia(QMediaContent(QUrl.fromLocalFile("/path/to/video.mp4"))) playlist.setPlaybackMode(QMediaPlaylist.Loop) player.setPlaylist(playlist) vw = QVideoWidget() player.setVideoOutput(vw) # this line triggers the error vw.show() player.play() sys.exit(app.exec_())
Windows 10 command line error on crash:
Segmentation fault