I've seen a number of other questions like this floating around but it seems many of them are unresolved or unrelated to my situation, so here goes.
I'm attempting to play back a video stored as serialized data (through pickle) on a mongodb collection.
Here's the code:
binary_file = my_database_entry['binary video'] unpickle = pickle.dumps(binary_file) outByteArray = QByteArray(unpickle) mediaStream = QBuffer() mediaStream.setBuffer(outByteArray) mediaStream.open(QIODevice.ReadWrite) mediaPlayer.setMedia(QMediaContent(), mediaStream) mediaPlayer.play() where 'my_database_entry' is the mongoDB entry and 'binary video' is the dictionary key for the pickled video entry. This also assumes that mediaPlayer is properly created and initialized within my user interface i.e.
mediaPlayer = QMediaPlayer(None, QMediaPlayer.VideoSurface) videoPlayer = QVideoWidget() mediaPlayer.setVideoOutput(videoPlayer) I also tried initializing mediaPlayer with a 'QMediaPlayer.StreamPlayback' flag but again, nothing.
It crashes when I try it on windows and it's just a black screen when I try it on mac. No error logs or anything (nothing enlightening at any rate).
Has anyone gotten this to successfully work for them and if so, how did you do it?
Thanks! -Mark