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. How to play h.264 video in Qt
Forum Updated to NodeBB v4.3 + New Features

How to play h.264 video in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 3 Posters 9.5k 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.
  • R Offline
    R Offline
    rockon209
    wrote on last edited by
    #1

    Hello guys I want to play a video in QMediaplayer whose codec is H.264. I build a video player and tried to play the h.264 file and got the following error with blank screen
    "DirectShowPlayerService::doRender: Unresolved error code 80040266"

    could anyone please help me how I can play the video.

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you have a h264 codec installed on your system ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rockon209
        wrote on last edited by
        #3

        Hi SGaist,

        No I dont have h.264 codec installed.However I am working on a project for commercial use so can download and install it as because of the licencing issues. Please let me know if you have any ideas.

        Thanks

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          IIRC, the K-Lite codec pack was pretty common for that task.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rockon209
            wrote on last edited by
            #5

            Ya but it has licencing issues i dont want to do that

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              So you want to play h.264 files but don't want to install any codecs for that ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • R Offline
                R Offline
                rockon209
                wrote on last edited by
                #7

                Means is there any other option like i can use vlc-qt lib but i dont know how to link vlc-qt lib with qt. If you know it please help me in that

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  The VLC-Qt website provides the documentation for that.

                  Note that VLC-Qt depends on libVLC which itself depends on x264 for h264 handling. x264 is free to use under the GPL license. If you want to create a closed source commercial product you can buy a license.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    rockon209
                    wrote on last edited by
                    #9

                    Where I can download and how I can x264 codec. I am new to videos and codec please help.
                    Thanks

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      rockon209
                      wrote on last edited by
                      #10

                      One more question I thought after reading about x264. It is used for encoding to h.264 and I am making a video player which displays h.264 video and therfore I need a decoder to decode the h.264 not encode. Correct me if I am wrong.
                      Thanks

                      1 Reply Last reply
                      0
                      • tekojoT Offline
                        tekojoT Offline
                        tekojo
                        wrote on last edited by
                        #11

                        Hi,
                        Yes, you need a h.264 decoder. x264 does both encode and decode.

                        As you are apparently working on a closed source project, you need to get a commercially licensed h.264 decoder. x264 is also available under a commercial license, see here https://licensing.x264.org/en/

                        Free decoders are generally under the GPL license, which will not work for your closed source program, as the licenses are incompatible.

                        1 Reply Last reply
                        2
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          An alternative would be to use a free format like webm.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            rockon209
                            wrote on last edited by
                            #13

                            Thank you for the information.
                            I have one more question I have downloaded the x264 codec from the website below. Could you help me in installing or building it in my desktop so that i can use it for Qt application
                            http://www.videolan.org/developers/x264.html

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              Do you mean using it through the VLC Qt project ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • R Offline
                                R Offline
                                rockon209
                                wrote on last edited by
                                #15

                                No not using VLC Qt project but directly how to install it in windows 10

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  You can either build it from sources or download the pre-built binary. It's all on the project's web page.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - 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