Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt 6.5 MediaPlayer and tcp stream

Qt 6.5 MediaPlayer and tcp stream

Scheduled Pinned Locked Moved Solved Qt 6
mediaplayerstreaming
6 Posts 3 Posters 1.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.
  • K Offline
    K Offline
    kbarni
    wrote on 4 May 2023, 11:58 last edited by
    #1

    I'm trying to display a simple tcp stream in a MediaPlayer object in Qt 6.5 (ffmpeg backend), but it doesn't seem to work. I tried to open it from my application, as well from the mediaplayer example.

    Here is a minimal example: I create a stream myself using gstreamer (mjpeg encoding):

    gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=I420 ! jpegenc quality=70 ! multipartmux ! tcpserversink host=127.0.0.1 port=5000
    

    I can open the stream using vlc (using url: tcp://127.0.0.1:5000) and using ffmpeg: ffplay tcp://127.0.0.1:5000. It can be decoded by gstreamer too: gst-launch-1.0 tcpclientsrc host=127.0.0.1 port=5000 ! multipartdemux ! jpegdec ! autovideosink

    However opening tcp://127.0.0.1:5000 as URL from the mediaplayer Qt example gives a "Could not open file" error.
    Same when setting the source property of a mediaplayer object to this URL.

    Can you give some hints how to open this stream? Or how can I build a stream that can be decoded by mediaplayer?

    J 1 Reply Last reply 4 May 2023, 12:17
    0
    • K kbarni
      4 May 2023, 11:58

      I'm trying to display a simple tcp stream in a MediaPlayer object in Qt 6.5 (ffmpeg backend), but it doesn't seem to work. I tried to open it from my application, as well from the mediaplayer example.

      Here is a minimal example: I create a stream myself using gstreamer (mjpeg encoding):

      gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=I420 ! jpegenc quality=70 ! multipartmux ! tcpserversink host=127.0.0.1 port=5000
      

      I can open the stream using vlc (using url: tcp://127.0.0.1:5000) and using ffmpeg: ffplay tcp://127.0.0.1:5000. It can be decoded by gstreamer too: gst-launch-1.0 tcpclientsrc host=127.0.0.1 port=5000 ! multipartdemux ! jpegdec ! autovideosink

      However opening tcp://127.0.0.1:5000 as URL from the mediaplayer Qt example gives a "Could not open file" error.
      Same when setting the source property of a mediaplayer object to this URL.

      Can you give some hints how to open this stream? Or how can I build a stream that can be decoded by mediaplayer?

      J Offline
      J Offline
      JonB
      wrote on 4 May 2023, 12:17 last edited by JonB 5 Apr 2023, 13:16
      #2

      @kbarni
      I don't know, but since Qt6 removed support for FTP protocol (QNetworkAccessManager) is this a non-starter trying to open a tcp:... Url schema whether for QMediaPlayer or otherwise?

      Oh dear, sorry, I thought it said ftp: not tcp: ! :(

      K 1 Reply Last reply 4 May 2023, 12:58
      0
      • J JonB
        4 May 2023, 12:17

        @kbarni
        I don't know, but since Qt6 removed support for FTP protocol (QNetworkAccessManager) is this a non-starter trying to open a tcp:... Url schema whether for QMediaPlayer or otherwise?

        Oh dear, sorry, I thought it said ftp: not tcp: ! :(

        K Offline
        K Offline
        kbarni
        wrote on 4 May 2023, 12:58 last edited by
        #3

        @JonB
        Normally TCP is the most low-level protocol (almost every other protocol sends data over TCP), so I don't know how this can be a problem. It definitely is supported by QTcpSocket.
        I tested without the tcp:// and it still doesn't work.
        Anyway, I was thinking that the URL was being sent directly to ffmpeg.

        Unfortunately the ffmpeg backend for Qt multimedia is not documented and QML is not very verbose when there's an error.

        J 1 Reply Last reply 4 May 2023, 13:15
        1
        • K kbarni
          4 May 2023, 12:58

          @JonB
          Normally TCP is the most low-level protocol (almost every other protocol sends data over TCP), so I don't know how this can be a problem. It definitely is supported by QTcpSocket.
          I tested without the tcp:// and it still doesn't work.
          Anyway, I was thinking that the URL was being sent directly to ffmpeg.

          Unfortunately the ffmpeg backend for Qt multimedia is not documented and QML is not very verbose when there's an error.

          J Offline
          J Offline
          JonB
          wrote on 4 May 2023, 13:15 last edited by JonB 5 Apr 2023, 13:17
          #4

          @kbarni said in Qt 6.5 MediaPlayer and tcp stream:

          Normally TCP is the most low-level protocol

          I had a complete mind-mess! I thought (for some reason) you were asking about ftp: protocol, which has indeed been removed at Qt6, not the tcp you wrote and I quoted! Consequently ignore my previous!!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 4 May 2023, 18:54 last edited by
            #5

            Hi,

            Since you mention 6.5, it's likely related to QTBUG-111910.

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

            K 1 Reply Last reply 5 May 2023, 08:09
            0
            • S SGaist
              4 May 2023, 18:54

              Hi,

              Since you mention 6.5, it's likely related to QTBUG-111910.

              K Offline
              K Offline
              kbarni
              wrote on 5 May 2023, 08:09 last edited by
              #6

              @SGaist Thank you! That should be probably it!
              I will test it on 6.5.1 when it will be released and report back.

              1 Reply Last reply
              0
              • K kbarni has marked this topic as solved on 5 May 2023, 08:10

              2/6

              4 May 2023, 12:17

              topic:navigator.unread, 4
              • Login

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