Comments (6)
I narrowed things down and it seems that
if (captureRect.isValid() && frameToProcess.size() != rect.size()) {
frameToProcess = image.copy(rect);
}
in QZxingFilterVideoSink.cpp is causing this crash. When i comment this line out, the app is not crashing. The example therefore does not recognize a barcode.
from qzxing.
After further testing with Qt 6.3 RC1 after suggestion from Qt support I have narrowed things a little more down. I've done a manual slowdown of the processing by adding a timer which sets a bool each second to true to allow processing of videoFrame:
void QZXingFilter::processFrame(const QVideoFrame &frame) {
if(allowProcessing)
allowProcessing = false;
else
return;
#ifdef Q_OS_ANDROID
m_videoSink->setRhi(nullptr); // https://bugreports.qt.io/browse/QTBUG-97789
QVideoFrame f(frame);
f.map(QVideoFrame::ReadOnly);
#else
const QVideoFrame &f = frame;
#endif // Q_OS_ANDROID
if(!isDecoding() && processThread.isFinished()){
QImage::Format image_format = QVideoFrameFormat::imageFormatFromPixelFormat(f.pixelFormat());
if(image_format == QImage::Format_Invalid){
qDebug() << image_format;
#ifdef Q_OS_ANDROID
if(f.isMapped())
f.unmap();
#endif
return;
}
When i comment m_videoSink->setRhi(nullptr); out I get invalid image format from the frame. And when I comment this line in the app crashes with the crashlog attached. Seems that there is a problem in getting correct image information from VideoFrame
QZXingLive_crashlog_QT6.3.0RC1.txt
.
from qzxing.
See this implementation: https://bugreports.qt.io/browse/QTBUG-97789?focusedCommentId=662706&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-662706
I tryed qzxing using qt 6.3 and didn't worked smooth (after 2-3 seconds there was only 1 frame in 5 seconds.
This implementatoin fixed the issue on my side.
Implementend on my side here: CMGeorge@10b917f#diff-cccfcad0b6ba438f5e4e6219f041e86fa651ea64921b2ba25ed5703af20c879f
(Thre is a mess because of auto formating... only void QZXingFilter::processFrame(const QVideoFrame &frame) should be change. and don't forget to set signals as dirrect connection like here:
connect(m_videoSink, &QVideoSink::videoFrameChanged, this, &QZXingFilter::processFrame,Qt::DirectConnection);
from qzxing.
Currently testing with Qt 6.5.0 and followed again the suggestions made in this thread. With master version the QZXing QrCode recognition is very slow and sluggish using QZXingLive. I've made following changes ot QZXingFilterVideoSink.cpp and with those changes QrCode-Scanning is working okay. https://gist.github.com/MichaelHeiser/5ab6ca42444a4c231ce0910ad0a4cf8a
from qzxing.
@MichaelHeiser do you ever get it working with Qt 6.2? Current QXZing master is always crashing Android application when executing QImage().copy.
I also tried the Qt6_2_multimedia branch but it does crash also.
from qzxing.
Currently working woth Qt 6.5.x. No changes to current version has to be made. QR-Code recognition is working as expected.
from qzxing.
Related Issues (20)
- UPC-A addon decoding issue
- QZXingTests - The Tests should detect the Barcode format as well HOT 1
- QrCode with text
- QZXing Crashing on Qt6.4 on IOS for latest Iphone 13 HOT 4
- Segmentation fault on android HOT 1
- No QR code is detected on Qt6.4/Ubuntu
- pdf417 Fail
- Qt 6.4.2 Android Qml loader issue
- Cannot open input file 'debug\cameraimagewrapper.oby HOT 3
- QAbstractVideoFilter not found
- Ios and Android with Qt 6.4.1
- compiling example QZXingLive : application.cpp:(.text+0x234): undefined reference to `NativeHelpers::application_p_' HOT 1
- Android Qt 6.5.0 build error
- When trying to decode a large number of DataMatrix from png (fed 2500 DataMatrix), not all were decoded HOT 1
- crash on QT android 5.15.13 QZXingFilter HOT 1
- SberPay QR codes are never detected HOT 5
- QAbstractVideoFilter removed in Qt6
- QT6.5.1 Memory leak with function
- Shared Object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qzxing.