Qt Multimedia QAbstractVideoFilter Missing in Qt 6.9
-
Hi everyone,
I’m working on a Qt Multimedia-based barcode scanning project using SCodes ZXing Barcode Wrapper with Qt 6.9 (MinGW). The project relied on QAbstractVideoFilter for video frame processing, but with Qt 6.9 I encountered this error: fatal error: QAbstractVideoFilter: No such file or directory
Project Details:
Qt Version: Qt 6.9Compiler: MinGW 64-bit
Build System: CMake
Modules Used: Qt Multimedia, Qt Quick, SCodes, ZXing
Troubleshooting So Far:- Verified Qt Multimedia is installed via Qt Maintenance Tool.
2 Explicitly linked Qt Multimedia in CMake: "
find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(my_project PRIVATE Qt6::Multimedia)
"
Any recommended fixes for barcode scanning with Qt Multimedia in Qt 6.9?
If anyone has solved this, your insights would be incredibly helpful!
Thanks in advance!
- Verified Qt Multimedia is installed via Qt Maintenance Tool.
-
I ported the application, but the barcode can't be scanned using SCodes ZXing Barcode Wrapper to Qt 6, but I am encountering difficulties when trying to decode the barcode after processing video frames.
The project originally used QAbstractVideoFilter (which was removed in Qt 6) to process video frames. I successfully ported the code by replacing QAbstractVideoFilter with other video frame processing mechanisms, but I am now unable to read the barcode from the frames.
" Problem:
After porting the code, the barcode isn’t detected even though the video frame is processed correctly.
The SBarcodeDecoder works in the sense that it doesn't throw exceptions anymore, but it also doesn't detect any barcodes.
-
I ported the application, but the barcode can't be scanned using SCodes ZXing Barcode Wrapper to Qt 6, but I am encountering difficulties when trying to decode the barcode after processing video frames.
The project originally used QAbstractVideoFilter (which was removed in Qt 6) to process video frames. I successfully ported the code by replacing QAbstractVideoFilter with other video frame processing mechanisms, but I am now unable to read the barcode from the frames.
" Problem:
After porting the code, the barcode isn’t detected even though the video frame is processed correctly.
The SBarcodeDecoder works in the sense that it doesn't throw exceptions anymore, but it also doesn't detect any barcodes.
@track said in Qt Multimedia QAbstractVideoFilter Missing in Qt 6.9:
The SBarcodeDecoder works in the sense that it doesn't throw exceptions anymore, but it also doesn't detect any barcodes.
Did you check the content of the frames you're passing to SBarcodeDecoder? Store them as images and see what's inside.
-
I checked the images(attached) but they are not detected as barcaodes .Here is the qml file "import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtMultimedia 6
import CustomFilters 1.0ApplicationWindow {
visible: true
width: 640
height: 480
title: "SCodess QR Scanner"Camera { id: camera active: true focusMode: Camera.FocusModeAutoNear customFocusPoint: Qt.point(0.5, 0.5) // Focus center } CaptureSession { id: session camera: camera videoOutput: videoOutput } VideoOutput { id: videoOutput anchors.fill: parent fillMode: VideoOutput.PreserveAspectCrop } SBarcodeFilter { id: barcodeFilter videoSink: videoOutput.videoSink captureRect: Qt.rect(0.25, 0.25, 0.5, 0.5) // Middle 50% of the frame onBarcodeDetected: console.log("Detected:", barcodeValue) } Rectangle { id: scanOverlay anchors.centerIn: parent width: parent.width * 0.5 height: parent.height * 0.5 color: "transparent" border.color: "lime" border.width: 2 radius: 4 z: 10 Rectangle { id: scanLine width: parent.width height: 2 color: "lime" radius: 1 y: 0 anchors.horizontalCenter: parent.horizontalCenter SequentialAnimation on y { loops: Animation.Infinite running: true NumberAnimation { from: 0 to: scanOverlay.height - scanLine.height duration: 1500 easing.type: Easing.InOutQuad } PauseAnimation { duration: 300 } NumberAnimation { from: scanOverlay.height - scanLine.height to: 0 duration: 1500 easing.type: Easing.InOutQuad } PauseAnimation { duration: 300 } } } } Component.onCompleted: { console.log("[Debug] VideoSink assigned?", videoOutput.videoSink !== null) }
}
"
-
Did you try the example that comes with that library ?
-
Then you should compare your code to it and adjust it.