1

I want to display video in Qt from Byte* stream which is I am getting from an C++ library. The video is coming from Astrisk server in VP8 format. I am able to get Byte* Stream from it in Qt now i want to display it in Qt window I am also getting all the information of video like frame rate, size, width, height. etc.

Iuliu
  • 4,001
  • 19
  • 31
user3924714
  • 33
  • 1
  • 7

1 Answers1

-1

You can have a QByteArray of the byte stream, provide a QBuffer from the QByteArray and pass the buffer as the stream for a QMediaPlayer :

databuf = QByteArray(reinterpret_cast<char*>(array), size);
QBuffer mediaStream(&databuf);

player = new QMediaPlayer;
player->setMedia(QMediaContent(), &buffer);

videoWidget = new QVideoWidget;
player->setVideoOutput(videoWidget);
videoWidget->show();

player->play();
Nejat
  • 31,784
  • 12
  • 106
  • 138