Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Play an FLV file inside an offline Qt App.
Forum Updated to NodeBB v4.3 + New Features

Play an FLV file inside an offline Qt App.

Scheduled Pinned Locked Moved General and Desktop
10 Posts 6 Posters 6.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bunjee
    wrote on last edited by
    #1

    Greetings Qt insiders,

    I have a tricky request. I have an FLV video and I'd like to play this in my Qt application.

    What's the simplest way ?

    • Convert it to AVI and then get Phonon to do the job ?
    • Use FFMpeg + QImage ?
    • An offline QtWebkit trick ?

    Thanks for your insights.

    B.A.

    N 1 Reply Last reply
    0
    • L Offline
      L Offline
      leppa
      wrote on last edited by
      #2

      AFAIK, FLV is just a container, like AVI or MKV. This means that it should be possible to play it using Phonon if you have all necessary codecs installed (both for the container and for the stream inside it). No need to convert. But I'm not an expert in this field so it's just an assumption.

      --
      With best regards,
      Oleksii Serdiuk <contacts[at]oleksii[dot]name>
      https://oleksii.name/

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        Afaik VLC media player is build using Qt. And VLC can play FLV files. so you could have a look at their code... Perhaps it helps.

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • F Offline
          F Offline
          florent.revelut
          wrote on last edited by
          #4
          • using ffmpeg + qimage, you'll have to deal yourself with framerate forn display, which is not a single bit easy. More over, you'll have to deal with audio nad worst, audio/video synchronisation. Time to start for a few months of development

          • offline qtWebkit trick : I don't see how webkit would be playing it... From what I know, the actual player is flash, not webkit, so it means it would be an offline flash player trick (no expert here however).

          • using phonon, if your backend is able to play it correctly, it should work. On windows (based on directshow), it would mean you have
            ** correct source (most probably asynch reader, part of standard directshow)
            ** splitter : to decapsulate flv into audio / video
            ** audio/video decoder : you can quite safely relyon ffdshow for this one
            To check it, start graphedit and try to play your file here : if it doesn't work, phonon won't be able to do it for you
            Sorry, i don't know on other targets.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bunjee
            wrote on last edited by
            #5

            Thanks Guys.

            The phonon backend is tempting, but installing all the goodies to make this work is a problem.

            I think FFMpeg could be the best solution.

            I've googled this : http://code.google.com/p/qtffmpegwrapper/

            That's a good starting point but it does not seem to handle sound.

            So now my question is more about sound. Do you think extracting video's sound and playing it through QAudioOutput is doable ? Is this such a huge task ? Should I implement OpenAL ?

            B.A.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leppa
              wrote on last edited by
              #6

              Can't say anything regarding the extraction, but you may face the problem of synchronization between video and audio.

              --
              With best regards,
              Oleksii Serdiuk <contacts[at]oleksii[dot]name>
              https://oleksii.name/

              1 Reply Last reply
              0
              • F Offline
                F Offline
                florent.revelut
                wrote on last edited by
                #7

                Usually, to display video, the audio clock generates flow for audio and video.

                If you go that way, you'll have to somehow be able to grab actual timestamping / clocking of your audio graph and then use that to synchronize your video playback : this isn't easy at all .

                If you have no experience in video playback, it's fairly easy to get sunken into nightmare of audio clicks, unsynchronized playback, lags, frozen threads (video playback is usually massively multithreaded).

                Having a look at QtMultimedia (I think it's in mobility now) might be a good idea as API are lower level than phonon, thus allowing potentially to grab / push data more easily.

                My advice on this subject of video playback : don't underestimate the work to make such things work, at least, it's heavy, more often, it's just huge if you expect good quality (e.g. dropping frames if rendering graph / CPU not quick enough to ensure correct A/V synchro linked to QoS)

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  ZapB
                  wrote on last edited by
                  #8

                  You may wish to take a look at "vlc-qt":http://sourceforge.net/p/vlc-qt/home/. That way vlc does all the heavy lifting for you.

                  Nokia Certified Qt Specialist
                  Interested in hearing about Qt related work

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bunjee
                    wrote on last edited by
                    #9

                    Looks like this might help: http://www.videolan.org/press/lgpl-libvlc.html

                    1 Reply Last reply
                    0
                    • B bunjee

                      Greetings Qt insiders,

                      I have a tricky request. I have an FLV video and I'd like to play this in my Qt application.

                      What's the simplest way ?

                      • Convert it to AVI and then get Phonon to do the job ?
                      • Use FFMpeg + QImage ?
                      • An offline QtWebkit trick ?

                      Thanks for your insights.

                      B.A.

                      N Offline
                      N Offline
                      newgloton
                      wrote on last edited by
                      #10
                      This post is deleted!
                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved