MediaPlayer VideoOutput SIGSEGV gst_v4l2_object_fill_format_list
-
With QML MediaPlayer and VideoOutput
and
player.source = "gstreamer-pipeline: v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1"We are getting an intermittent SIGSEGV in
gst_v4l2_object_fill_format_list
in /usr/src/debug/gstreamer1.0-plugins-good/1.24.0.imx/sys/v4l2/gstv4l2object.cIt either fails early, or works and keeps working.
By comparison, the following always works:
player.source = "gstreamer-pipeline: videotestsrc ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1"This is on a custom board/custom Yocto
NXP i.MX 8X
ADV7280A-M -
try from command line:
gst-launch-1.0 v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1 | autovideosink
or
gst-launch-1.0 v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1 | waylandsink
to see if your pipeline works or not at first.If not, show the output here.
gst-launch-1.0 -v v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1 | autovideosink -
try from command line:
gst-launch-1.0 v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1 | autovideosink
or
gst-launch-1.0 v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1 | waylandsink
to see if your pipeline works or not at first.If not, show the output here.
gst-launch-1.0 -v v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1 | autovideosink -
Hi @JoeCFD thank you for replying. Yes pipeline works from the command line each time:
gst-launch-1.0 v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1 ! autovideosink
-
@petero3 I guess Qt6 might have removed this feature of running a gstreamer pipeline. This feature is only available in Qt5.
-
@petero3 I guess Qt6 might have removed this feature of running a gstreamer pipeline. This feature is only available in Qt5.
IIRC gstreamer pipelines were removed in the first Qt 6 versions, but are present in later ones.
The following works fine with Qt 6.8.3:
player.source = "gstreamer-pipeline: videotestsrc ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1"
As long as source is set dynamically onCompleted as per:
https://bugreports.qt.io/browse/QTBUG-134554and:
player.source = "gstreamer-pipeline: v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1"
does not always fail. If gst_v4l2_object_fill_format_list is going to segfault, it does so early. If it doesn't segfault, then it works.
So present, but flaky for some reason.
We are also trying qml6glsink, but so far that just gives a white screen on our device.
-
IIRC gstreamer pipelines were removed in the first Qt 6 versions, but are present in later ones.
The following works fine with Qt 6.8.3:
player.source = "gstreamer-pipeline: videotestsrc ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1"
As long as source is set dynamically onCompleted as per:
https://bugreports.qt.io/browse/QTBUG-134554and:
player.source = "gstreamer-pipeline: v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1"
does not always fail. If gst_v4l2_object_fill_format_list is going to segfault, it does so early. If it doesn't segfault, then it works.
So present, but flaky for some reason.
We are also trying qml6glsink, but so far that just gives a white screen on our device.
-
@JoeCFD thank you.
Below is the code for the MediaPlayer/VideoOutput with the intermittent segfault.
Will ask my colleague to share the code for the qml6glsink
We also have this gstreamer post re that:
https://discourse.gstreamer.org/t/qmlsink-example-on-imx8qxp-board-doesnt-render-videotstsrc-only-white-screen/4579#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QFile> int main(int argc, char *argv[]) { qputenv("GST_DEBUG", "4"); qputenv("GST_DEBUG_DUMP_DOT_DIR", "/appdata/"); qputenv("QT_LOGGING_RULES", "*.multimedia.*=true"); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; QObject::connect( &engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.loadFromModule("video", "Main"); return app.exec(); }
import QtQuick import QtMultimedia Window { width: 1280 height: 768 visible: true title: qsTr("Hello World") Item { anchors.fill: parent MediaPlayer { id: player videoOutput: videoOutput } VideoOutput { id: videoOutput anchors.fill: parent } Component.onCompleted: { // works //player.source = "gstreamer-pipeline: videotestsrc ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1" // segfaults intermittently player.source = "gstreamer-pipeline: v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1" player.play() } } }
-
PS. For the qml6glsink white screen issue, the code is the standard qmlsink example:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-plugins-good/tests/examples/qt6/qmlsink?ref_type=heads
https://discourse.gstreamer.org/t/qmlsink-example-on-imx8qxp-board-doesnt-render-videotstsrc-only-white-screen/4579 -
PS. For the qml6glsink white screen issue, the code is the standard qmlsink example:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-plugins-good/tests/examples/qt6/qmlsink?ref_type=heads
https://discourse.gstreamer.org/t/qmlsink-example-on-imx8qxp-board-doesnt-render-videotstsrc-only-white-screen/4579@petero3 does your code work on Ubuntu or Redhat?
Is wayland applied in Yocto? If yes, the following envs are needed.#ifdef YOCTO setenv( "DISPLAY", ":0", 1 ); setenv( "GDK_BACKEND", "wayland", 1 ); setenv( "QT_QPA_PLATFORM", "wayland", 1 ); setenv( "XDG_RUNTIME_DIR", "/run/user/1000", 1 ); setenv( "WAYLAND_DISPLAY", "wayland-1", 1 ); setenv( "QT_QPA_FONTDIR", "/usr/share/fonts/truetype", 1 ); #endif