PDA

View Full Version : Work with video files (movies), audio, images



Chiz
11th January 2011, 12:52
I need to get specific info about file (e.g video, audio, image).
I can load file using standart open file dialog, but I didn't find(using google) how to get information about VIDEO file, not just file.
If somebody know how to get such kind of specific info not just from video file but from audio (duration, bitrate...) and/or image(height, bit depth...) post info here.
Many thanks for your time!

tbscope
11th January 2011, 12:56
You can use Phonon or QtMultimedia.
Or more general, GStreamer, Xine, VLC, ...

But if you want to read the data with your own code, you need to look into the different file formats. Most of them are described and can be found via a search engine.
Prepare to spend a lot of time implementing them.

high_flyer
11th January 2011, 13:08
If you mean info like duration of the video and similar media specific info, you need to know the specific format of the file.
MP3 for example have headers (depending on the format implementation) that hold various information about the artist, and other information.
There is no general or standard way to retrieve this info.
You need to know which format the files you are looking at conform to.

Chiz
11th January 2011, 13:24
Let's talk about video, for example.
I choose file. I have
QString filePath = QFileDialog::getOpenFileName();. What next? What classes i have to use to get to know what format is current video file have? I can get suffix
QFileInfo file(filePath);
QString fileSuffix = file.suffix();. But, as I understand, you mean codec.

tbscope
11th January 2011, 13:27
A codec is not a file format.

A codec is an encoder and/or decoder for a specific video or audio file (among others).
The video or audio can be encoded in, for example, mpeg format. You need the decoder to turn the encoded videostream in the file into something useable.

Now, most meta data is probably in some binary form or just plain text form in the file.
For that, you need to know where and how that information is stored in the file, thus you need the file format (not the encoding of the media).