<i id='rq005'><tr id='rq005'><dt id='rq005'><q id='rq005'><span id='rq005'><b id='rq005'><form id='rq005'><ins id='rq005'></ins><ul id='rq005'></ul><sub id='rq005'></sub></form><legend id='rq005'></legend><bdo id='rq005'><pre id='rq005'><center id='rq005'></center></pre></bdo></b><th id='rq005'></th></span></q></dt></tr></i><div id='rq005'><tfoot id='rq005'></tfoot><dl id='rq005'><fieldset id='rq005'></fieldset></dl></div>

    1. <tfoot id='rq005'></tfoot>
        <bdo id='rq005'></bdo><ul id='rq005'></ul>
      <legend id='rq005'><style id='rq005'><dir id='rq005'><q id='rq005'></q></dir></style></legend>

    2. <small id='rq005'></small><noframes id='rq005'>

      使用 Qt 播放实时视频流

      Play a Live video Stream using Qt(使用 Qt 播放实时视频流)
          • <bdo id='D2W3m'></bdo><ul id='D2W3m'></ul>

            <tfoot id='D2W3m'></tfoot>
          • <i id='D2W3m'><tr id='D2W3m'><dt id='D2W3m'><q id='D2W3m'><span id='D2W3m'><b id='D2W3m'><form id='D2W3m'><ins id='D2W3m'></ins><ul id='D2W3m'></ul><sub id='D2W3m'></sub></form><legend id='D2W3m'></legend><bdo id='D2W3m'><pre id='D2W3m'><center id='D2W3m'></center></pre></bdo></b><th id='D2W3m'></th></span></q></dt></tr></i><div id='D2W3m'><tfoot id='D2W3m'></tfoot><dl id='D2W3m'><fieldset id='D2W3m'></fieldset></dl></div>

              <tbody id='D2W3m'></tbody>

          • <small id='D2W3m'></small><noframes id='D2W3m'>

          • <legend id='D2W3m'><style id='D2W3m'><dir id='D2W3m'><q id='D2W3m'></q></dir></style></legend>

                本文介绍了使用 Qt 播放实时视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                下面给出了使用 Qt 播放视频文件的代码.我想播放来自 IP 摄像机的实时视频流,而不是播放视频.另一种方法是在 Qt 中嵌入 VLC 播放器,并在此处提供了该项目的链接.问题是我不知道如何将播放器包含在 Qt 中.那么我该如何进行呢?

                Given below is the code for playing a video file using Qt. Instead of playing the video I want to play a live video stream from an IP Camera. Another approach is to embed the VLC Player in Qt and a link for the project is provided here. The problem is I do not know how to include the player in Qt. So how do I proceed?

                #include <QApplication>
                #include <QtMultimediaWidgets/QVideoWidget>
                #include <QtMultimedia/QMediaPlayer>
                #include <QtMultimedia/QMediaPlaylist>
                #include <QFile>
                #include <QHBoxLayout>
                #include "DemoPlayer.h"
                int main(int argc, char *argv[])
                {
                    QApplication a(argc, argv);
                
                    QWidget *widget=new QWidget;
                    widget->resize(400,300);
                
                    QMediaPlayer *player=new QMediaPlayer;
                    QVideoWidget *vw= new QVideoWidget;
                    QHBoxLayout *layout=new QHBoxLayout;
                
                    layout->addWidget(vw);
                    widget->setLayout(layout);
                    player->setVideoOutput(vw);
                    player->setMedia(QUrl::fromLocalFile("C:/Users/Administrator/Desktop/1minute.mp4"));
                    player->play();
                    widget->show();
                    qDebug()<<player->availableMetaData()<<player->currentMedia().canonicalUrl();
                
                    return a.exec();
                }
                

                推荐答案

                遵循此代码.您可以使用有效的窗口 id 将小部件嵌入到另一个小部件中.如何显示其他应用程序的输出视频在 Qt 中?您可以使用 qx11embedwidget 和 qx11embedwidgetcontainerQX11EmbedWidget 和 QX11EmbedContainer

                follow this code . you can embed a widget inside another widget using a valid window id . How to show output video of other application in Qt? you can use the qx11embedwidget and qx11embedwidgetcontainer QX11EmbedWidget and QX11EmbedContainer

                这篇关于使用 Qt 播放实时视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Consistent pseudo-random numbers across platforms(跨平台一致的伪随机数)
                Vary range of uniform_int_distribution(改变uniform_int_distribution的范围)
                What is a seed in terms of generating a random number?(就生成随机数而言,种子是什么?)
                Is 1.0 a valid output from std::generate_canonical?(1.0 是 std::generate_canonical 的有效输出吗?)
                Getting big random numbers in C/C++(在 C/C++ 中获取大随机数)
                What is the best way to generate random numbers in C++?(在 C++ 中生成随机数的最佳方法是什么?)
                <i id='mkk2t'><tr id='mkk2t'><dt id='mkk2t'><q id='mkk2t'><span id='mkk2t'><b id='mkk2t'><form id='mkk2t'><ins id='mkk2t'></ins><ul id='mkk2t'></ul><sub id='mkk2t'></sub></form><legend id='mkk2t'></legend><bdo id='mkk2t'><pre id='mkk2t'><center id='mkk2t'></center></pre></bdo></b><th id='mkk2t'></th></span></q></dt></tr></i><div id='mkk2t'><tfoot id='mkk2t'></tfoot><dl id='mkk2t'><fieldset id='mkk2t'></fieldset></dl></div>

                  <small id='mkk2t'></small><noframes id='mkk2t'>

                        <legend id='mkk2t'><style id='mkk2t'><dir id='mkk2t'><q id='mkk2t'></q></dir></style></legend>
                          <tbody id='mkk2t'></tbody>
                          <bdo id='mkk2t'></bdo><ul id='mkk2t'></ul>
                          <tfoot id='mkk2t'></tfoot>