Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116782

FFmpeg backend: RTSP stream is very choppy in Qt, compared to FFplay

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.4, 6.6.1
    • 6.5.2, 6.6.0 Beta3
    • Multimedia
    • Windows 10 22H2, MSVC 2019 x64, VLC 3.0.18, ffplay 6.0 (installed from Chocolatey)
    • 2ec4170ac (dev), e2910eac2 (6.6), 9918c243b (6.5), 7ba178db0 (dev), 015b24017 (6.9), 5b4d30993 (6.8), a85cfeebc (dev), 034295c95 (6.9), 5e1d8bdfc (6.8)

    Description

      Code

      import QtQuick
      import QtMultimedia
      import QtQuick.Controls.Fusion
      
      Window {
          id: root
          width: 800
          height: 600
          visible: true
          title: `${video.source} (${video.playbackState})`
      
          Video {
              id: video
              anchors.fill: parent
              source: "rtsp://localhost:8090/stream"
          }
          
          Button {
              text: video.playbackState === MediaPlayer.StoppedState ? "Play" : "Stop"
              onClicked: {
                  if (video.playbackState === MediaPlayer.StoppedState)
                      video.play()
                  else
                      video.stop()
              }
          }
      }
      

       

      Steps to reproduce

      1. Start a local RTSP server
      2. Run the code above
      3. Click "Play"
      4. Wait for the video to start playing (it might take ~10 seconds)
      5. While Qt is still playing the video, play the same stream using ffplay

       

      Outcomes

      The issues faced by Qt appear before ffplay is launched, so they are not caused by having multiple receivers:

      • The video playback in Qt is choppy (video stream might freeze/glitch every now and then; audio stream might go silent every now and then)
      • The same video stream plays perfectly smoothly in ffplay
      • Qt shows missed packets in stderr:
      [rtsp @ 000002842BA285C0] The profile-level-id field value is not a valid number: 64001f
      qt.multimedia.ffmpeg.mediadataholder: AVStream duration -9223372036854775808 is invalid. Taking it from the metadata
      qt.multimedia.ffmpeg.mediadataholder: AVStream duration -9223372036854775808 is invalid. Taking it from the metadata
      "Invalid argument"
      [rtsp @ 000002842BA285C0] method PAUSE failed: 405 Method not allowed
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 178 packets
          failed to get textures for frame; format: 172 textureConverter null
      [rtsp @ 000002842BA285C0] jitter buffer full
      [rtsp @ 000002842BA285C0] RTP: missed 413 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] jitter buffer full
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 1 packets
      [rtsp @ 000002842BA285C0] max delay reached. need to consume packet
      [rtsp @ 000002842BA285C0] RTP: missed 2 packets
      ...
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              artemiy Artem Dyomin
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: