Answer the question
In order to leave comments, you need to log in
How to open and run a video file from a rar/zip archive without saving it on the hard drive, but immediately placing it in the op?
The program creates a player
self.mplPlayer = QtMultimedia.QMediaPlayer()
mc = QtMultimedia.QMediaContent(QtCore.QUrl.fromLocalFile(file_name))
self.mplPlayer.setMedia(mc)
and so on.
file_name - avi file in zip/rar archive. It is extracted from the archive, written to the hard drive and launched. Then it is removed. Everything is working. How can I run it in the player without first saving it to the hard drive?
Answer the question
In order to leave comments, you need to log in
For streaming video, an option is available when you extract the file and send the stream to the player (let it be stdin / stdout or system pipes), but in your case it is avi, unfortunately it requires random access to the file to play (the player reads the end of the file, as I I understand that the index is located there), the only way to do this is to implement a web server that returns the requested sections of files.
In the case of an archive, it will be very inefficient for you to constantly unpack it, since random access within the file is also not supported (to get the end of the file, you need to start unpacking from the beginning).
ps Keeping media in zip archives is absolutely pointless, since they are not compressed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question