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* Str
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();