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.0k 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 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 last edited by mostefa
      #2

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

      H 1 Reply Last reply
      0
      • M mostefa

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

        H Offline
        H Offline
        HW-Developer
        wrote on 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

        JonBJ 1 Reply Last reply
        0
        • H HW-Developer

          @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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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
          0
          • JonBJ JonB

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

            JonBJ jsulmJ 2 Replies Last reply
            0
            • H HW-Developer

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

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on 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
              3
              • H HW-Developer

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

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on 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
                • JonBJ JonB

                  @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 last edited by HW-Developer
                  #8

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

                  Pablo J. RoginaP 1 Reply Last reply
                  0
                  • H HW-Developer

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

                    Pablo J. RoginaP Offline
                    Pablo J. RoginaP Offline
                    Pablo J. Rogina
                    wrote on 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

                    • Login

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