i have an encrypted video file, i want to decrypt this file into memory and then use this data play video. but qt mediaplayer class is to pass a file name in, i need to have any good way?
this is my code
#!/usr/bin/env pythonfrom PyQt5.QtCore import QFile, QFileInfo, QIODevice, QUrl, QDataStream
from PyQt5.QtWidgets import QApplication
from PyQt5.QtMultimedia import QMediaPlayer, QMediaContent
from PyQt5.QtMultimediaWidgets import QVideoWidgetif __name__ == '__main__':import sys
app = QApplication(sys.argv)
player = QMediaPlayer()file = QFile('mymusic.avi')
stream = QDataStream(file)
# this is where i want read form stream? how can i read from stream?
player.setMedia(QMediaContent(QUrl.fromLocalFile('mymusic.avi')))videoWidget = QVideoWidget()
player.setVideoOutput(videoWidget)
videoWidget.show()player.play()
sys.exit(app.exec_())
look, param is filename,but i want to read from a binary data,how can i do?