Ip camera in Qt+QGst+Raspberry Pi
Rodrigo Angel Astorga
rodrigo.angel at gmail.com
Wed Oct 28 19:49:00 PDT 2015
hi guys, I need help to implement a viewer IP camera from a Raspberry Pi, I'm working with Qt Creator and API Qt-GStreamer, the API works well when loading in the pipeline "scrvideotest", on the other hand directly from gstreamer using the following command line "sudo gst-launch-1.0 rtspsrc location=rtsp://admin:123456@192.168.10.123:554/ <http://admin:123456@192.168.10.123:554/> ! rtph264depay ! h264parse ! omxh264dec ! autovideosink" works perfect. When I try to create the pipeline based on the above instructions do not work in program debugging errors GET_ELEMET tells me that is not rtph264depay; h264parse; omxh264dec. And I can not generate the link between the components, if they could help me create the correct instructions to create the pipeline would greatly appreciate, I copy the code on which I work.
Thank you.
My code in Qt Creator ans Qt-Gstreamer API, run in Raspberry Pi
#include <QGst/Init>
#include <QGst/Pipeline>
#include <QGst/ElementFactory>
#include <QGst/Ui/GraphicsVideoSurface>
#include <QGst/Ui/GraphicsVideoWidget>
#include <qapplication>
#include <qglwidget>
#include <qgraphicsview>
#include <qdebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGst::init(&argc, &argv);
QGraphicsScene* scene = new QGraphicsScene;
QGraphicsView* view = new QGraphicsView(scene);
view->setViewport(new QGLWidget);
QGst::Ui::GraphicsVideoSurface* surface = new QGst::Ui::GraphicsVideoSurface(view);
QGst::Ui::GraphicsVideoWidget* widget = new QGst::Ui::GraphicsVideoWidget();
widget->setSurface(surface);
QGst::ElementPtr source = QGst::ElementFactory::make("rtspsrc”);
QGst::ElementPtr demux = QGst::ElementFactory::make("rtph264depay”);
QGst::ElementPtr parse = QGst::ElementFactory::make("h264parse”);
QGst::ElementPtr decode = QGst::ElementFactory::make("omxh264dec");
QGst::ElementPtr sink = surface->videoSink();
QGst::PipelinePtr pipeline = QGst::Pipeline::create();
source->SetProperty(“location”, "rtsp://admin:123456@192.168.10.123:554/ <rtsp://admin:123456@192.168.10.123:554/>“);
pipeline->add(source);
pipeline->add(demux);
pipeline->add(parse);
pipeline->add(decode);
pipeline->add(sink);
if(source->link(demux) == false)
qDebug(“Link demux failed”);
if(demux->link(parse) == false)
qDebug("Link parse failed”);
if(parse->link(decode) == false)
qDebug(“Link decode failed”);
if(decode->link(sink) == false)
qDebug("Link sink failed");
scene->addItem(widget);
pipeline->setState(QGst::StatePlaying);
view->show();
return a.exec();
}
Example code in Qt Creator ans Qt-Gstreamer API, run in Raspberry Pi work fine!!
#include <QGst/Init>
#include <QGst/Pipeline>
#include <QGst/ElementFactory>
#include <QGst/Ui/GraphicsVideoSurface>
#include <QGst/Ui/GraphicsVideoWidget>
#include <qapplication>
#include <qglwidget>
#include <qgraphicsview>
#include <qdebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGst::init(&argc, &argv);
QGraphicsScene* scene = new QGraphicsScene;
QGraphicsView* view = new QGraphicsView(scene);
view->setViewport(new QGLWidget);
QGst::Ui::GraphicsVideoSurface* surface = new QGst::Ui::GraphicsVideoSurface(view);
QGst::Ui::GraphicsVideoWidget* widget = new QGst::Ui::GraphicsVideoWidget();
widget->setSurface(surface);
QGst::ElementPtr source = QGst::ElementFactory::make("videotestsrc");
QGst::ElementPtr sink = surface->videoSink();
QGst::PipelinePtr pipeline = QGst::Pipeline::create();
pipeline->add(source);
pipeline->add(sink);
if(source->link(sink) == false)
qDebug(“Link failed”);
scene->addItem(widget);
pipeline->setState(QGst::StatePlaying);
view->show();
return a.exec();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151028/cb06fbb1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2675 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151028/cb06fbb1/attachment-0001.bin>
More information about the gstreamer-devel
mailing list