Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

RTSP Stream with Qt



  • Hi°, I have an RTSP address that can be play on VLC. When i try to play it with QMediaPlayer i am getting this error:

    DirectShowPlayerService::doSetUrlSource: Unresolved error code 800c000d

    QMediaPlayer *player;
    player = new QMediaPlayer(this);
    
    QGraphicsScene *scene = new QGraphicsScene;
    ui->graphicsView->setScene(scene);
    
    player->setMedia(QUrl("rtsp://192.168.0.55....."));
    player->play();
    

    When i try to play an mp4 file, it is ok but rtsp address cannot be shown. Any information?


  • Lifetime Qt Champion

    Hi
    It depends on the backend, Qt is using for media on each platform.
    On linux, its gstreamer which can handle RTSP but on windows, its DirectShow and
    i think you need something extra for it to work.
    https://sourceforge.net/projects/rtspdirectshow/

    Disclaimer. i did not try this myself. just read about it.



  • Hi,
    I once used RTSP streams together with Qt.

    There I used OpenCV in the middle. It uses ffmpeg as backend and ffmpeg can handle RTSP.
    An OpenCV mat can easily be converted to e.g. QImage.

    Probably you could also use ffmpeg directly without OpenCV.

    Maybe this helps.



  • @mrjj @robro

    I just downloaded K-Lite codec pack and now i can display rtsp address stream. I think DirectShow as default can not handle/decode the stream.


Log in to reply