0

Qt android project running error:

E VLC     : [ecde5360/57d8] libvlc window: libvlc_media_player options not set
E VLC     : [ecb18c40/5884] libvlc vout display: parent window not available
E VLC     : [ecd8bc50/57d8] libvlc video output: video output creation failed
E VLC     : [e524d780/57d8] libvlc decoder: failed to create video output

I want know how to fix it. There is sound but no picture when running.

my mainwindow.h code: I defined the lable in the ui interface. libvlc_media_player_set_xwindow() is to set the playback stream embedded in the component of the interface. Here it is embedded in lable. winId() gets the ID of the component. Finally libvlc_media_player_play () plays the screen.

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    vlcInstance = libvlc_new (0, NULL);
    QString url = "rtsp://192.168.50.84:8554/stream";
    media  = libvlc_media_new_location (vlcInstance, url.toStdString().c_str());
    libvlc_media_add_option(media, ":rtsp-tcp");
    mediaPlayer  = libvlc_media_player_new_from_media (media);
    libvlc_media_player_set_xwindow(mediaPlayer, ui->label->winId());
    libvlc_media_player_play (mediaPlayer);
}

mainwindow.cpp code:

#include <QMainWindow>
#include <QMutex>
#include <vlc/vlc.h>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
private:
    Ui::MainWindow *ui;
    libvlc_instance_t * vlcInstance ;
    libvlc_media_player_t *mediaPlayer ;
    libvlc_media_t *media ;
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

};

0 Answers0