Open customized video file
Hi
I would like to use my own customized QIODevice to open a video file in QT using Phonon. This should theoretically allow me to play specially encrypted video files. I noticed that MediaSource ( QIODevice * ioDevice ) can take an QIODevice and as a test I tried a basic QFile as a source.
Code:
VideoPlayer* video = new VideoPlayer(Phonon::VideoCategory);
main->setWidget(video); // My own class that puts the VideoPlayer on the window at the correct position.
{
video->play(MediaSource(f));
}
When I debug the code, the file opens successfully, but I only get a "black box" with no video or audio.
When I replace MediaSource(f) with MediaSource("data/myvideo.MP4"), it works but I would like to be able to modify (decrypt) the stream before it get send to the VideoPlayer.
Any ideas?
Re: Open customized video file
Which OS?
I'm thinking of the caveat: "Under Windows, we only support QIODevices containing the avi, mp3, or mpg formats"
Re: Open customized video file
Is this one Windows? If so, the documentation says:
Quote:
Warning: On Windows, we only support QIODevices containing the avi, mp3, or mpg formats. Use the constructor that takes a file name to open files (the Qt backend does not use a QFile internally).
Re: Open customized video file
Yes, I am developing for Windows now. Will probably port to other platforms at a later stage.
If QT does not support QFile internally, are there maybe another way to manipulate the byte stream before passing it to the Phonon Framework without rewriting QT's source code?
Re: Open customized video file
Depending on the size of the video, perhaps QBuffer? It does mean holding the entire content in memory, which isn't ideal and maybe impossible.
Otherwise, difficult, as the player will assume a file and treat as such, so you can't really stream it.
Re: Open customized video file
Quote:
Originally Posted by
cass
If QT does not support QFile internally, are there maybe another way to manipulate the byte stream before passing it to the Phonon Framework without rewriting QT's source code?
Note that Phonon was only designed to create simple playback of media files.