I am trying to stream a video over tcp based on gstreamer daemon. I have created a pipeline which streams video over tcp socket as below:
pipeline_create p videotestsrc is-live=true pattern="ball" ! x264enc ! queue ! mpegtsmux ! tcpserversink host=0.0.0.0 port=12345
Now I am designing a Video player application in Qt, which will receive the above video stream and play it.The code is as below
#include "dialog.h"
#include <QApplication>
#include<QMediaPlayer>
#include<QVideoWidget>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//Dialog w;
//w.show();
QMediaPlayer *player=new QMediaPlayer;
QVideoWidget *vw=new QVideoWidget;
player->setVideoOutput(vw);
QUrl *url=new QUrl("http://127.0.0.1:12345");
QMediaContent *mc=new QMediaContent(*url);
player->setMedia(*mc);
vw->setGeometry(100,100,300,400);
vw->show();
player->play();
qDebug()<<player->state();
return a.exec();
}
At first when I got the error code 0x80040266, I Installed K-lite codec and LAV Filters and after that only for the first time my video player was able to stream and play the video as shown.
But then, when I again try to play my video player, it shows below error
DirectShowPlayerService::doRender: Unresolved error code 0x80040266 (IDispatch error #102)
Can anyone guide me with this?