Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to build and run qml-player #10

Open
ShettyRa opened this issue Jun 9, 2017 · 1 comment
Open

how to build and run qml-player #10

ShettyRa opened this issue Jun 9, 2017 · 1 comment

Comments

@ShettyRa
Copy link

ShettyRa commented Jun 9, 2017

I have successfully built and run simple-player.

I would like to run the qml-player. As there is no .pro file to execute in (https://github.com/vlc-qt/examples/tree/master/qml-player) I created my own project and copied main.cpp to the sources of my project and video.qml of (https://github.com/vlc-qt/examples/tree/master/qml-player/src/qml) to main.qml of my project.

project name

video

This is how my

video.pro looks:

TEMPLATE = app
QT += qml quick
CONFIG += c++11
SOURCES += main.cpp
RESOURCES += qml.qrc

INCLUDEPATH += "C:\Users\rshe\Desktop\Qt projects\VLC-Qt_1.0.1_win64_msvc2013\include"

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = "C:\Users\rshe\Desktop\Qt projects\VLC-Qt_1.0.1_win64_msvc2013\bin"

# Default rules for deployment.
include(deployment.pri)

main.cpp

#include <QtCore/QCoreApplication>
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickView>

#include <VLCQtCore/Common.h>
#include <VLCQtQml/QmlVideoPlayer.h>

int main(int argc, char *argv[])
{
    QCoreApplication::setApplicationName("VLC-Qt QML Player");
    QCoreApplication::setAttribute(Qt::AA_X11InitThreads);

    QGuiApplication app(argc, argv);
    VlcCommon::setPluginPath(app.applicationDirPath() + "/plugins");
    VlcQmlVideoPlayer::registerPlugin();

    QQuickView quickView;
    quickView.setSource(QUrl(QStringLiteral("qrc:/qml/video.qml")));
    quickView.setResizeMode(QQuickView::SizeRootObjectToView);
    quickView.show();

    return app.exec();
}

main.qml

import QtQuick 2.0
import QtQuick.Window 2.2
import VLCQt 1.0

Rectangle {
    width: 640
    height: 480
    color: "black"

    VlcVideoPlayer {
        id: vidwidget
        anchors.fill: parent
        url: "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0&unicast=true"
    }
}

the proble is with the import VLCQt 1.0 it says qml module not found

When i build i get this three errors:

main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl VlcCommon::setPluginPath(class QString const &)" (__imp_?setPluginPath@VlcCommon@@YA_NAEBVQString@@@Z) referenced in function main

main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl VlcQmlVideoPlayer::registerPlugin(void)" (__imp_?registerPlugin@VlcQmlVideoPlayer@@SAXXZ) referenced in function main

debug\video.exe:-1: error: LNK1120: 2 unresolved externals

Can anyone help what am I missing.

Thanks in advance.

@ShettyRa
Copy link
Author

ShettyRa commented Jun 9, 2017

Hi,

Finally succeeded with building and running qml-player with the CmakeList.txt on Qt. I think the problem was with my compiler and setting up CMaker.

Now I have one more problem that is latency in the streaming.

In the simple-player the latency was reduced by setting the option media->setOption(":network-caching=200")

I am wondering how to set this in the qml. I have tried various options in the video.qml (ex:VlcMedia->setOption(":network-caching=300"); , VlcMedia::setOption(":network-caching=300");) but it dosent work.

Looking forward for some help

Thanks ntadej

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant