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. Issues with using Qt Multimedia with ffmpeg in Qt 6.5, audio streaming on MacOS

Issues with using Qt Multimedia with ffmpeg in Qt 6.5, audio streaming on MacOS

Scheduled Pinned Locked Moved Solved General and Desktop
qtmultimediaffmpegstreamingmacos
7 Posts 2 Posters 2.6k 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.
  • S Offline
    S Offline
    szumial
    wrote on 9 May 2023, 16:16 last edited by
    #1

    Hi! I have a project where I use a QMediaPlayer to play audio files. I have set the "QT_MEDIA_BACKEND=ffmpeg" variable. While playing local files works flawlessly, passing an url to a file hosted in a cloud service with HTTPS protocol fails with the following error: https protocol not found, recompile FFmpeg with openssl, gnutls or securetransport enabled.

    How do I resolve this issue? I don't know where to start if I wanted to recompile FFmpeg as suggested in the application output. Below is some more explanation of my actual problem.

    I have read that ffmpeg will become the default backend for Qt Multimedia since Qt 6.5. I am interested in using it, since the native backend on MacOS does not seem to work with files streamed from cloud - QMediaPlayer reports a QMediaPlayer::FormatError when I try to play a file. On Windows I have no issues with audio streaming with the native OS backend.

    The minimal code-example used to play audio files is as follows (I don't think it is relevant in this case though):

    void MainWindow::playAudio(const QUrl &url)
    {
    	mediaPlayer.setSource(url);
    	mediaPlayer.play();
    }
    

    Any input to this issue will be much appreciated.

    S 1 Reply Last reply 9 May 2023, 19:10
    0
    • S szumial
      9 May 2023, 16:16

      Hi! I have a project where I use a QMediaPlayer to play audio files. I have set the "QT_MEDIA_BACKEND=ffmpeg" variable. While playing local files works flawlessly, passing an url to a file hosted in a cloud service with HTTPS protocol fails with the following error: https protocol not found, recompile FFmpeg with openssl, gnutls or securetransport enabled.

      How do I resolve this issue? I don't know where to start if I wanted to recompile FFmpeg as suggested in the application output. Below is some more explanation of my actual problem.

      I have read that ffmpeg will become the default backend for Qt Multimedia since Qt 6.5. I am interested in using it, since the native backend on MacOS does not seem to work with files streamed from cloud - QMediaPlayer reports a QMediaPlayer::FormatError when I try to play a file. On Windows I have no issues with audio streaming with the native OS backend.

      The minimal code-example used to play audio files is as follows (I don't think it is relevant in this case though):

      void MainWindow::playAudio(const QUrl &url)
      {
      	mediaPlayer.setSource(url);
      	mediaPlayer.play();
      }
      

      Any input to this issue will be much appreciated.

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 May 2023, 19:10 last edited by
      #2

      Hi,

      You are likely hitting QTBUG-110708.

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

      S 1 Reply Last reply 10 May 2023, 06:02
      0
      • S SGaist
        9 May 2023, 19:10

        Hi,

        You are likely hitting QTBUG-110708.

        S Offline
        S Offline
        szumial
        wrote on 10 May 2023, 06:02 last edited by szumial
        #3

        @SGaist Hi! Thank you for the quick reply. I will test it again with Qt 6.5.1 then and mark the thread as solved if this fixes my issues :)

        @SGaist Actually further testing shows that it is not the backend of Qt Multimedia that causes the issue, although I have some hope that ffmpeg could resolve it. The problem when using the native OS backend (MacOS = darwin) seems to come from the QUrl I pass to the setSource() method. My URL points to a file hosted online and although it works on Windows when I am streaming the file and I can download the file both on Windows and MacOS, I cannot play it on MacOS as if it is wrongly interpreted. Are there any special requirements for the QUrl passed to the setSource()?

        S 1 Reply Last reply 10 May 2023, 19:29
        0
        • S szumial
          10 May 2023, 06:02

          @SGaist Hi! Thank you for the quick reply. I will test it again with Qt 6.5.1 then and mark the thread as solved if this fixes my issues :)

          @SGaist Actually further testing shows that it is not the backend of Qt Multimedia that causes the issue, although I have some hope that ffmpeg could resolve it. The problem when using the native OS backend (MacOS = darwin) seems to come from the QUrl I pass to the setSource() method. My URL points to a file hosted online and although it works on Windows when I am streaming the file and I can download the file both on Windows and MacOS, I cannot play it on MacOS as if it is wrongly interpreted. Are there any special requirements for the QUrl passed to the setSource()?

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 May 2023, 19:29 last edited by
          #4

          Which protocol are you using ?

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

          S 1 Reply Last reply 16 May 2023, 09:09
          0
          • S SGaist
            10 May 2023, 19:29

            Which protocol are you using ?

            S Offline
            S Offline
            szumial
            wrote on 16 May 2023, 09:09 last edited by
            #5

            @SGaist Sorry for the late reply. What do you mean by "protocol"? I host the files in a cloud service, which I prompt for the file URL. It is always using the HTTPS protocol. Strange that it works on Windows, but not MacOS. Interestingly, using the URL on MacOS in VLC works just fine and I can stream the media. As mentioned in the original question, setting source to such URL results in a QMediaPlayer::FormatError, which is a hint, but too cryptic to understand what the cause is.

            S 1 Reply Last reply 16 May 2023, 19:03
            0
            • S szumial
              16 May 2023, 09:09

              @SGaist Sorry for the late reply. What do you mean by "protocol"? I host the files in a cloud service, which I prompt for the file URL. It is always using the HTTPS protocol. Strange that it works on Windows, but not MacOS. Interestingly, using the URL on MacOS in VLC works just fine and I can stream the media. As mentioned in the original question, setting source to such URL results in a QMediaPlayer::FormatError, which is a hint, but too cryptic to understand what the cause is.

              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 16 May 2023, 19:03 last edited by
              #6

              @szumial since there's an issue with the backend network support in 6.5.0, I think it's related to what you are experiencing.

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

              S 1 Reply Last reply 16 May 2023, 20:16
              0
              • S SGaist
                16 May 2023, 19:03

                @szumial since there's an issue with the backend network support in 6.5.0, I think it's related to what you are experiencing.

                S Offline
                S Offline
                szumial
                wrote on 16 May 2023, 20:16 last edited by szumial
                #7

                @SGaist Yes in case of Qt 6.5.0, but this also happens with Qt 6.3.1, although the error I can read from QMediaPlayer is different:

                • Qt 6.5.0: QMediaPlayer::ResourceError
                • Qt 6.3.1: QMediaPlayer::FormatError

                Edit:
                The root cause of this issue was connected to file types and the way my url was constructed. I opted to use the native darwin backend with Qt 6.5 instead of the new ffmpeg, at least until 6.5.1 is out and I can do further testing. Thank you for the valuable input (as always!).

                1 Reply Last reply
                0
                • S szumial has marked this topic as solved on 23 May 2023, 06:46
                • Y YANL referenced this topic on 26 Oct 2023, 13:18

                2/7

                9 May 2023, 19:10

                topic:navigator.unread, 5
                • Login

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