QML getting MetaData of Video File



  • I am using Qt 5.2.1 on Ubuntu.
    I am using FolderListModel in QML. My list is of video files.
    I can able to get selected file Name using

    videoModel.get(videoList.currentIndex, "fileName")
    

    But if i want to get MetaData like video duration and resolution of that video file how can i get that?


  • Moderators

    @RiteshPanchal AFAIK Video type might be useful in extracting video metaData.



  • Hi p3c0.
    Thanks for the Reply.

    I am using Qt 5.2.1 on nvidia TX1 Ubuntu with qt-gstreamer 1.2.1.
    When i use Video on QML. I got following error

    (VideoBox:9602): GLib-GObject-WARNING **: cannot register existing type 'GstObject'
    
    (VideoBox:9602): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
    
    (VideoBox:9602): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed
    
    (VideoBox:9602): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
    
    (VideoBox:9602): GStreamer-CRITICAL **: gst_element_class_set_details_simple: assertion 'GST_IS_ELEMENT_CLASS (klass)' failed
    
    (VideoBox:9602): GStreamer-WARNING **: static caps 0xf1e9172c string is NULL
    
    (VideoBox:9602): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed
    
    (VideoBox:9602): GStreamer-WARNING **: static caps 0xf1e9176c string is NULL
    
    (VideoBox:9602): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed
    
    (VideoBox:9602): GStreamer-WARNING **: static caps 0xf1e9172c string is NULL
    
    (VideoBox:9602): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed
    

    Even if i use QMediaPlayer in Qt C++ i am getting the same error as above.

    QMediaPlayer *player = new QMediaPlayer(this);
    

    I think something is missing between Qt and Gstreamer.


  • Moderators

    @RiteshPanchal Try setting following env. variables set before application execution. This will print some detailed information:

    export QT_DEBUG_PLUGINS=1
    export GST_DEBUG=3
    


  • @p3c0 said in QML getting MetaData of Video File:

    export QT_DEBUG_PLUGINS=1

    Please find the error log.

    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqeglfs.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqeglfs.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "eglfs"
            ]
        },
        "className": "QEglFSIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("eglfs") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqkms.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqkms.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "kms"
            ]
        },
        "className": "QKmsIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("kms") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqlinuxfb.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqlinuxfb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "linuxfb"
            ]
        },
        "className": "QLinuxFbIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("linuxfb") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqminimal.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqminimal.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "minimal"
            ]
        },
        "className": "QMinimalIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("minimal") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqminimalegl.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqminimalegl.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "minimalegl"
            ]
        },
        "className": "QMinimalEglIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("minimalegl") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqoffscreen.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqoffscreen.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "offscreen"
            ]
        },
        "className": "QOffscreenIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("offscreen") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqxcb.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqxcb.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2",
        "MetaData": {
            "Keys": [
                "xcb"
            ]
        },
        "className": "QXcbIntegrationPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("xcb") 
    QFactoryLoader::QFactoryLoader() checking directory path "/home/ubuntu/VideoBox/build-VideoBox-TX1-Debug/platforms" ... 
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqxcb.so" 
    loaded library "Xcursor" 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platformthemes" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platformthemes/libappmenu-qt5.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platformthemes/libappmenu-qt5.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
        "MetaData": {
            "Keys": [
                "appmenu-qt5"
            ]
        },
        "className": "AppMenuPlatformThemePlugin",
        "debug": true,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("appmenu-qt5") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platformthemes/libqgtk2.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platformthemes/libqgtk2.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
        "MetaData": {
            "Keys": [
                "gtk2"
            ]
        },
        "className": "QGtk2ThemePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gtk2") 
    QFactoryLoader::QFactoryLoader() checking directory path "/home/ubuntu/VideoBox/build-VideoBox-TX1-Debug/platformthemes" ... 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforminputcontexts" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface",
        "MetaData": {
            "Keys": [
                "compose"
            ]
        },
        "className": "QComposePlatformInputContextPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("compose") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface",
        "MetaData": {
            "Keys": [
                "ibus"
            ]
        },
        "className": "QIbusPlatformInputContextPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("ibus") 
    QFactoryLoader::QFactoryLoader() checking directory path "/home/ubuntu/VideoBox/build-VideoBox-TX1-Debug/platforminputcontexts" ... 
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/arm-linux-gnueabihf/qt5/plugins/generic" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevkeyboardplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevkeyboardplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevKeyboard"
            ]
        },
        "className": "QEvdevKeyboardPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevkeyboard") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevmouseplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevmouseplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevMouse"
            ]
        },
        "className": "QEvdevMousePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevmouse") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevtabletplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevtabletplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevTablet"
            ]
        },
        "className": "QEvdevTabletPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevtablet") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevtouchplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/generic/libqevdevtouchplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QGenericPluginFactoryInterface",
        "MetaData": {
            "Keys": [
                "EvdevTouch"
            ]
        },
        "className": "QEvdevTouchScreenPlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("evdevtouch") 
    QFactoryLoader::QFactoryLoader() checking directory path "/home/ubuntu/VideoBox/build-VideoBox-TX1-Debug/generic" ... 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick.2/libqtquick2plugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0",
        "MetaData": {
        },
        "className": "QtQuick2Plugin",
        "debug": false,
        "uri": [
            "QtQuick.2"
        ],
        "version": 328193
    }
    
    
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick.2/libqtquick2plugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick/Window.2/libwindowplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0",
        "MetaData": {
        },
        "className": "QtQuick2WindowPlugin",
        "debug": false,
        "uri": [
            "QtQuick.Window.2"
        ],
        "version": 328193
    }
    
    
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick/Window.2/libwindowplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0",
        "MetaData": {
        },
        "className": "QtQuickControlsPlugin",
        "debug": false,
        "uri": [
            "QtQuick.Controls"
        ],
        "version": 328193
    }
    
    
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick/Controls/libqtquickcontrolsplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/qml/Qt/labs/folderlistmodel/libqmlfolderlistmodelplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QQmlExtensionInterface",
        "MetaData": {
        },
        "className": "QmlFolderListModelPlugin",
        "debug": false,
        "uri": [
            "Qt.labs.folderlistmodel"
        ],
        "version": 328193
    }
    
    
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/qml/Qt/labs/folderlistmodel/libqmlfolderlistmodelplugin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/qml/QtMultimedia/libdeclarative_multimedia.so, metadata=
    {
        "IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0",
        "MetaData": {
        },
        "className": "QMultimediaDeclarativeModule",
        "debug": false,
        "uri": [
            "QtMultimedia"
        ],
        "version": 328193
    }
    
    
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/qml/QtMultimedia/libdeclarative_multimedia.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick/Layouts/libqquicklayoutsplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0",
        "MetaData": {
        },
        "className": "QtQuickLayoutsPlugin",
        "debug": false,
        "uri": [
            "QtQuick.Layouts"
        ],
        "version": 328193
    }
    
    
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/qml/QtQuick/Layouts/libqquicklayoutsplugin.so" 
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice" ... 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstaudiodecoder.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstaudiodecoder.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreameraudiodecode"
            ],
            "Services": [
                "org.qt-project.qt.audiodecode"
            ]
        },
        "className": "QGstreamerAudioDecoderServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreameraudiodecode") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstcamerabin.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstcamerabin.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreamercamerabin"
            ],
            "Services": [
                "org.qt-project.qt.camera"
            ]
        },
        "className": "CameraBinServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreamercamerabin") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstmediacapture.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstmediacapture.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreamermediacapture"
            ],
            "Services": [
                "org.qt-project.qt.audiosource"
            ]
        },
        "className": "QGstreamerCaptureServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreamermediacapture") 
    QFactoryLoader::QFactoryLoader() looking at "/usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstmediaplayer.so" 
    Found metadata in lib /usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstmediaplayer.so, metadata=
    {
        "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
        "MetaData": {
            "Keys": [
                "gstreamermediaplayer"
            ],
            "Services": [
                "org.qt-project.qt.mediaplayer"
            ]
        },
        "className": "QGstreamerPlayerServicePlugin",
        "debug": false,
        "version": 328193
    }
    
    
    Got keys from plugin meta data ("gstreamermediaplayer") 
    QFactoryLoader::QFactoryLoader() checking directory path "/home/ubuntu/VideoBox/build-VideoBox-TX1-Debug/mediaservice" ... 
    loaded library "/usr/lib/arm-linux-gnueabihf/qt5/plugins/mediaservice/libgstmediaplayer.so" 
    
    (VideoBox:16248): GLib-GObject-WARNING **: cannot register existing type 'GstObject'
    
    (VideoBox:16248): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
    
    (VideoBox:16248): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed
    
    (VideoBox:16248): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
    
    (VideoBox:16248): GStreamer-CRITICAL **: gst_element_class_set_details_simple: assertion 'GST_IS_ELEMENT_CLASS (klass)' failed
    
    (VideoBox:16248): GStreamer-WARNING **: static caps 0xf1d4872c string is NULL
    
    (VideoBox:16248): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed
    
    (VideoBox:16248): GStreamer-WARNING **: static caps 0xf1d4876c string is NULL
    
    (VideoBox:16248): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed
    
    (VideoBox:16248): GStreamer-WARNING **: static caps 0xf1d4872c string is NULL
    
    (VideoBox:16248): GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object != NULL' failed
    

    I found some links that describes the same issue. I am not getting the solution perhaps you can help.
    http://stackoverflow.com/questions/17521026/gstreamer-runtime-error
    https://github.com/OpenBoard-org/OpenBoard/issues/4


  • Moderators

    @RiteshPanchal Have you installed all the dependencies as described here ?

    To run applications that use Qt Multimedia, you might also need to install the following GStreamer plugins: 'good', 'ugly', 'bad', ffmpeg (0.10), and libav (1.x). These additional plugins contain various codecs for audio and video decoding, as well as the necessary components for using the camera APIs.

    Also check if both you have accidentally installed gstreamer 0.10.x and 1.x. Try keeping either one.

    Also export GST_DEBUG=3 will give more detailed output on console.



  • @p3c0 By default both gstreamer 0.10 and 1.0 were installed on TX1.
    How can i remove 0.10 completely.?


  • Moderators

    @RiteshPanchal Well that depends upon the distro used. On debian systems apt-get remove --purge package-name works. Try searching online how to remove the exact package.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.