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. Media File format
Forum Updated to NodeBB v4.3 + New Features

Media File format

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 5 Posters 1.1k Views 2 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.
  • H Offline
    H Offline
    HW-Developer
    wrote on 17 Oct 2018, 14:10 last edited by HW-Developer
    #1

    Hello everyone!
    I am trying to create a simple media player, so I want to open some media files from a directory (which i already did) but i want to split audio files and video files from each other. If any one have an idea, i really appreciate if someone can help, please!

    0_1539785371277_Capture.PNG

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mostefa
      wrote on 17 Oct 2018, 15:22 last edited by mostefa
      #2

      Hi @HW-Developer
      Are you just looking for QTabWidget .?

      H 1 Reply Last reply 17 Oct 2018, 15:28
      0
      • M mostefa
        17 Oct 2018, 15:22

        Hi @HW-Developer
        Are you just looking for QTabWidget .?

        H Offline
        H Offline
        HW-Developer
        wrote on 17 Oct 2018, 15:28 last edited by
        #3

        @mostefa No I did already create the tabwidget (look to the screenshot), i want to split audio files from video files and display each one of them in a different tab

        J 1 Reply Last reply 17 Oct 2018, 21:28
        0
        • H HW-Developer
          17 Oct 2018, 15:28

          @mostefa No I did already create the tabwidget (look to the screenshot), i want to split audio files from video files and display each one of them in a different tab

          J Offline
          J Offline
          JonB
          wrote on 17 Oct 2018, 21:28 last edited by
          #4

          @HW-Developer
          Still don't understand. You want simply to display some files on one tab and others on another? You have separate files for audio and video? Does their file extension change? How do you know which are which?

          H 1 Reply Last reply 17 Oct 2018, 22:23
          0
          • J JonB
            17 Oct 2018, 21:28

            @HW-Developer
            Still don't understand. You want simply to display some files on one tab and others on another? You have separate files for audio and video? Does their file extension change? How do you know which are which?

            H Offline
            H Offline
            HW-Developer
            wrote on 17 Oct 2018, 22:23 last edited by HW-Developer
            #5

            @JonB Ok, for example, you click the add button to load some media files, you choose a list that you want to play, if that list contains audio files it will be displayed just in the first(all) and third tab(audio) and if it contains video files, it will be displayed in the first(all) and the second tab(video).
            So i think if i want to achieve that goal, i have to create a function that will verify the files extensions. but i do not know how to do it as a beginner.

            J J 2 Replies Last reply 17 Oct 2018, 22:57
            0
            • H HW-Developer
              17 Oct 2018, 22:23

              @JonB Ok, for example, you click the add button to load some media files, you choose a list that you want to play, if that list contains audio files it will be displayed just in the first(all) and third tab(audio) and if it contains video files, it will be displayed in the first(all) and the second tab(video).
              So i think if i want to achieve that goal, i have to create a function that will verify the files extensions. but i do not know how to do it as a beginner.

              J Offline
              J Offline
              JonB
              wrote on 17 Oct 2018, 22:57 last edited by JonB
              #6

              @HW-Developer
              Yes, if the file types depend on the file names' extensions. Look at http://doc.qt.io/qt-5/qdir.html for stuff to do with "name filters", e.g. something like http://doc.qt.io/qt-5/qdir.html#QDir-2 might be right/a start.

              Or, if you just want to use whatever code you already have which has all filenames, just look at the segment at the end of each name (there are dedicated functions for this like http://doc.qt.io/qt-5/qfileinfo.html#suffix, or just write your own code treating it as a string) to decide which type of file each one is.

              H 1 Reply Last reply 18 Oct 2018, 12:49
              3
              • H HW-Developer
                17 Oct 2018, 22:23

                @JonB Ok, for example, you click the add button to load some media files, you choose a list that you want to play, if that list contains audio files it will be displayed just in the first(all) and third tab(audio) and if it contains video files, it will be displayed in the first(all) and the second tab(video).
                So i think if i want to achieve that goal, i have to create a function that will verify the files extensions. but i do not know how to do it as a beginner.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 18 Oct 2018, 07:24 last edited by
                #7

                @HW-Developer Sounds like you need http://doc.qt.io/qt-5/qmimedatabase.html

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

                1 Reply Last reply
                3
                • J JonB
                  17 Oct 2018, 22:57

                  @HW-Developer
                  Yes, if the file types depend on the file names' extensions. Look at http://doc.qt.io/qt-5/qdir.html for stuff to do with "name filters", e.g. something like http://doc.qt.io/qt-5/qdir.html#QDir-2 might be right/a start.

                  Or, if you just want to use whatever code you already have which has all filenames, just look at the segment at the end of each name (there are dedicated functions for this like http://doc.qt.io/qt-5/qfileinfo.html#suffix, or just write your own code treating it as a string) to decide which type of file each one is.

                  H Offline
                  H Offline
                  HW-Developer
                  wrote on 18 Oct 2018, 12:49 last edited by HW-Developer
                  #8

                  @JonB @jsulm Does anyone know what are the Qt supported Multimedia formats files ?

                  P 1 Reply Last reply 18 Oct 2018, 13:37
                  0
                  • H HW-Developer
                    18 Oct 2018, 12:49

                    @JonB @jsulm Does anyone know what are the Qt supported Multimedia formats files ?

                    P Offline
                    P Offline
                    Pablo J. Rogina
                    wrote on 18 Oct 2018, 13:37 last edited by
                    #9

                    @HW-Developer please remember that Qt Multimedia is as capable as the multimedia implementation of the underlying OS; from its documentation:

                    Limitations
                    The Qt Multimedia APIs build upon the multimedia framework of the underlying platform. This can mean that support for various codecs or containers can vary between machines, depending on what the end user has installed.

                    So I'd suggest you go and try using libraries ffmpeg (libavformat/libavcodec) or libvlc inside your Qt application which will give you plenty of capabilities regarding audio and video handling.

                    You may want to take a look at ffplay simple player regarding how those libraries are used (source code).

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    3

                    1/9

                    17 Oct 2018, 14:10

                    • Login

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