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. QMediaPlayer Problems with H265 and H264 Streams.
Qt 6.11 is out! See what's new in the release blog

QMediaPlayer Problems with H265 and H264 Streams.

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 2.4k Views 1 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.
  • T Offline
    T Offline
    TeaBear5
    wrote on last edited by
    #1

    I am attempting to display a stream broadcast with the following gstreamer pipeline:

    gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=4056, height=3040, framerate=30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), width=507, height=380' ! nvv4l2h265enc insert-sps-pps=true iframeinterval=30 ! h265parse ! rtph265pay ! queue ! udpsink host=192.168.0.130 port=5100
    

    I am able to view the output of that stream using the following gstreamer pipeline on a second computer:

    gst-launch-1.0 udpsrc port=5100 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H265" ! rtph265depay ! h265parse ! avdec_h265 ! videoconvert ! autovideosink
    

    Additionally, I can view the stream using ffmpeg:

    ffmpeg -protocol_whitelist file,udp,rtp -buffer_size 1000000 -i testing.sdp -f sdl "Output"
    

    The testing.sdp looks like the following:

    v=0
    o=- 123456 1 IN IP4 127.0.0.1
    s=Sample
    c=IN IP4 127.0.0.1
    t=0 0
    m=video 5100 RTP/AVP 96
    a=rtpmap:96 H265/90000
    

    I can also open that .sdp with vlc and view the stream.

    I am having substantial trouble with trying to get this working in Qt6.6.0. Here is my mainwindow.cpp:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent),
        ui(new Ui::MainWindow) {
        ui->setupUi(this);
    
        // Initialize player and video widget
        player = new QMediaPlayer(this);
        videoWidget = new QVideoWidget(this);
    
        // Set video widget as central widget
        setCentralWidget(videoWidget);
    
        // Set video output to the video widget
        player->setVideoOutput(videoWidget);
    
        // Set the media source URL with your UDP stream
        //player->setSource(QUrl("http://username:password@192.168.0.207/axis-cgi/mjpg/video.cgi"));
    
        // Set the media source URL with your SDP file
        //player->setSource(QUrl::fromLocalFile("/path/to/testing.sdp"));
        
        // Set the media source URL with your UDP stream
        player->setSource(QUrl("udp://@:5100"));
    
        // Start playing
        player->play();
    }
    
    MainWindow::~MainWindow() {
        delete ui;
    }
    

    I have validated the the first commented out stream for another ip camera works as intended but I have problems with attempting the 2 different ways to read for the stream I want to. I have additionally tried with both the ffmpeg and gstreamer backends, swapping with the following:

    export QT_DEFAULT_MEDIA_BACKEND=gstreamer
    export QT_MEDIA_BACKEND=gstreamer
    

    or

    export QT_DEFAULT_MEDIA_BACKEND=ffmpeg
    export QT_MEDIA_BACKEND=ffmpeg
    

    I have additionally tried changing to h264 instead with no effect. The ffmpeg backend gives me the following errors that I can seem to fix:

    qt.multimedia.ffmpeg.libsymbolsresolver: Couldn't load OpenSsl library
    qt.multimedia.ffmpeg.libsymbolsresolver: Couldn't load VAAPI library
    

    and the gstreamer backend gives me the following errors:

    qt.multimedia.player: Unable to set the pipeline to the paused state.
    

    or when trying the .sdp method:

    qt.multimedia.player: Warning: "No decoder available for type 'application/sdp'."
    

    Any help would be greatly appreciated, I have been struggling with this for a few days. Additionally my understanding is the custom gstreamer pipelines aren't supported in qt 6.6.0, but I may try a custom pipeline on an old version of qt 5 instead.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      It seems you are missing the libva package on your system.

      Also, which version of OpenSSL do you have installed ?

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

      1 Reply Last reply
      0

      • Login

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