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. QMediaPlayer does not play many formats
Forum Update on Monday, May 27th 2025

QMediaPlayer does not play many formats

Scheduled Pinned Locked Moved Unsolved General and Desktop
17 Posts 5 Posters 3.2k Views
  • 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #1

    Hi!
    QMediaPlayer does not play .mp4, wma; play wmv.
    How do I play other formats?

    jsulmJ 1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      Platform dependent. QMediaPlayer is a front-end for the media framework that already exists on your machine. If your machine lacks the proper codecs then QMedia won't know how to play the formats.

      Also, keep in mind that if the content is DRM protected then it would require an OS that embraces DRM (ie windoze).

      1 Reply Last reply
      2
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #3

        at the very least, QMediaPlayer should play h.264 (mp4) "out of the box" with no special configuration, imho. there are free decoders for that that should just be included. sigh.

        1 Reply Last reply
        0
        • M Mikeeeeee

          Hi!
          QMediaPlayer does not play .mp4, wma; play wmv.
          How do I play other formats?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @mikeeeeee On which platform?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            davecotter
            wrote on last edited by
            #5

            well the mac can just play them. on windows i think Qt should include an mp4 decoder. and probably on linux too but i don't personally need that.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mikeeeeee
              wrote on last edited by Mikeeeeee
              #6

              I have Windows 7, mp4 does not work, only wmv works .

              1 Reply Last reply
              0
              • D Offline
                D Offline
                davecotter
                wrote on last edited by
                #7

                right, and i think that's a problem. it should work out of the box. you can get it to work by manually installing the k-lite codec pack but the end user shouldn't HAVE to do that just to play an mp4

                1 Reply Last reply
                0
                • fcarneyF Offline
                  fcarneyF Offline
                  fcarney
                  wrote on last edited by
                  #8

                  Codec packs are notorious for having malware/viruses in them.

                  Isn't MP4 a container? It can have different codecs for video and audio in them if I remember right. Or am I thinking of a different format?

                  C++ is a perfectly valid school of magic.

                  1 Reply Last reply
                  0
                  • fcarneyF Offline
                    fcarneyF Offline
                    fcarney
                    wrote on last edited by
                    #9

                    Also, you might consider embedding vlc in your Qt project.
                    https://wiki.videolan.org/LibVLC_SampleCode_Qt
                    Not sure if the license is compatible with what your doing though.

                    I have embedded it in a Python app before and it supports a ton of formats.

                    C++ is a perfectly valid school of magic.

                    D 1 Reply Last reply
                    2
                    • D Offline
                      D Offline
                      davecotter
                      wrote on last edited by
                      #10

                      yes viruses exist, but that's not the point of this post. (off topic: k-lite is legit)

                      yes mp4 is a container but the important one is h.264

                      1 Reply Last reply
                      0
                      • fcarneyF fcarney

                        Also, you might consider embedding vlc in your Qt project.
                        https://wiki.videolan.org/LibVLC_SampleCode_Qt
                        Not sure if the license is compatible with what your doing though.

                        I have embedded it in a Python app before and it supports a ton of formats.

                        D Offline
                        D Offline
                        davecotter
                        wrote on last edited by
                        #11

                        @fcarney i see nothing about licensing for libvlc, is it LGPL?

                        1 Reply Last reply
                        0
                        • fcarneyF Offline
                          fcarneyF Offline
                          fcarney
                          wrote on last edited by
                          #12

                          @davecotter
                          I just cringe when hear about downloading codecs. I am really biased against them. Thanks for a link to a legit one. Those are hard to find.

                          https://wiki.videolan.org/Frequently_Asked_Questions/
                          Looks like LibVLC is LGPL. So it should be compatible for most Qt projects.

                          C++ is a perfectly valid school of magic.

                          D 1 Reply Last reply
                          0
                          • fcarneyF fcarney

                            @davecotter
                            I just cringe when hear about downloading codecs. I am really biased against them. Thanks for a link to a legit one. Those are hard to find.

                            https://wiki.videolan.org/Frequently_Asked_Questions/
                            Looks like LibVLC is LGPL. So it should be compatible for most Qt projects.

                            D Offline
                            D Offline
                            davecotter
                            wrote on last edited by
                            #13

                            @fcarney i hope what you mean is "i'm biased against things that are viruses, disguised as useful utilities" or "i'm biased against forcing the end user to download and install an app dependency", not that you're generally against extending the functionality of a media player

                            yeah i have LibVLC on my radar, as well as ffmpeg (which i think VLC depends on anyway?), haven't made a decision yet

                            jsulmJ 1 Reply Last reply
                            0
                            • fcarneyF Offline
                              fcarneyF Offline
                              fcarney
                              wrote on last edited by
                              #14

                              @davecotter said in QMediaPlayer does not play many formats:

                              i'm biased against forcing the end user to download and install an app dependency

                              ...which has a high likelyhood of giving the end user a virus because they downloaded the wrong thing. That is where I am at.

                              C++ is a perfectly valid school of magic.

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                Mikeeeeee
                                wrote on last edited by
                                #15

                                What should I do with VLC media player? How to embed in the project and how to use?

                                1 Reply Last reply
                                0
                                • D Offline
                                  D Offline
                                  davecotter
                                  wrote on last edited by
                                  #16

                                  see the link above about LibVLC

                                  1 Reply Last reply
                                  0
                                  • D davecotter

                                    @fcarney i hope what you mean is "i'm biased against things that are viruses, disguised as useful utilities" or "i'm biased against forcing the end user to download and install an app dependency", not that you're generally against extending the functionality of a media player

                                    yeah i have LibVLC on my radar, as well as ffmpeg (which i think VLC depends on anyway?), haven't made a decision yet

                                    jsulmJ Offline
                                    jsulmJ Offline
                                    jsulm
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17

                                    @davecotter said in QMediaPlayer does not play many formats:

                                    i'm biased against forcing the end user to download and install an app dependency

                                    Then provide them with your app.
                                    The problems with codecs are: licenses.
                                    That's why Linux distributions often do not provide all available codecs by default and the user of the distribution has to install them explecetly (like on Ubuntu with bad/ugly versions of GStreamer plug-ins from universe repository). Same for Qt I guess: Qt projects does not want to get in troubles because of providing codecs for not really free media formats (not free, full of patents, ...).

                                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    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