Results 1 to 5 of 5

Thread: Work with video files (movies), audio, images

  1. #1
    Join Date
    Dec 2010
    Location
    Ukraine, Kharkiv
    Posts
    17
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Work with video files (movies), audio, images

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Work with video files (movies), audio, images

    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.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Work with video files (movies), audio, images

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Dec 2010
    Location
    Ukraine, Kharkiv
    Posts
    17
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Post Re: Work with video files (movies), audio, images

    Let's talk about video, for example.
    I choose file. I have
    Qt Code:
    1. QString filePath = QFileDialog::getOpenFileName();
    To copy to clipboard, switch view to plain text mode 
    . What next? What classes i have to use to get to know what format is current video file have? I can get suffix
    Qt Code:
    1. QFileInfo file(filePath);
    2. QString fileSuffix = file.suffix();
    To copy to clipboard, switch view to plain text mode 
    . But, as I understand, you mean codec.

  5. #5
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Work with video files (movies), audio, images

    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).

Similar Threads

  1. Reading audio AND video metadata from files (Phonon?)
    By garfunkel in forum Qt Programming
    Replies: 0
    Last Post: 1st March 2010, 07:32
  2. Phonon(video and audio separately)
    By Fastman in forum Qt Programming
    Replies: 3
    Last Post: 1st February 2010, 06:30
  3. Replies: 3
    Last Post: 5th July 2009, 17:22
  4. Webkit audio/video integration
    By TTGator in forum Qt Programming
    Replies: 0
    Last Post: 26th February 2009, 19:17
  5. Greenphone audio/video
    By void* in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 2nd February 2007, 05:41

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.