Solved QCamera is not working with CMOS-MIPI-OV5640
-
Looks like a device specific source
@nikita.panchal09 said in QCamera is not working with CMOS-MIPI-OV5640:
imxv4l2videosrc
You should consider modifying the gstreamer plugin to use that one in place of the
camerabin
it currently uses. -
Hi,
Thank you for your answer.
Actually, I am new to GStreamer and qtmultimedia. I would be grateful, if you can provide steps or related website-link to do these things.Meanwhile, I found the hardcoded value of camera source as "v4l2src" in below files from QT source. Do these both files requires to change to "imxv4l2videosrc" from "v4l2src" and build it again?
- qtmultimedia-5.12/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp:70: GstElement *camera = gst_element_factory_make("v4l2src", "camera_source");
- qtmultimedia-5.12/src/plugins/gstreamer/camerabin/camerabinsession.cpp:542: m_videoSrc = gst_element_factory_make("v4l2src", "camera_source");
Thanks.
-
That's what I would try first yes. No need to rebuild all of Qt. Only the GStreamer plugin.
-
Hi,
I followed below steps:
- Downloaded qt-multimedia
- Edited mentioned files with "imxv4l2videosrc"
- Compiled and Installed.
It works...! I am able to start the camera.
Thank you
-
Hi,
Currently, I am trying to record video on IMX6(Debian Stretch 9.5). I am using QT multimediawidget "camera" example (Using QCamera and QMediaRecorder).
The problem is, On record start (recorder->record) the camera output is slowed down extremely. and after approximate 15 seconds, It gives below error and streaming gets stopped.
"CameraBin error: "Internal data stream error."I am able to record video with gstreamer using below command and it works fine.
gst-launch-1.0 imxv4l2videosrc device=/dev/video0 imx-capture-mode=5 fps-n=30 ! queue ! imxvpuenc_h264 bitrate=10000 ! avimux ! filesink location=test.aviLooking forward to hearing.
Thank You.
-
From the looks of it,
imxvpuenc_h264
is likely optimised for your device. I would go check theqgstreamercapturesession.cpp
content to see how to possibly modify the pipeline to use that encoder. -
Hi,
Thanks for your answer.
While analyzing the problem I found below things as per below:
- In the computer, it saves video file as .mkv and in the board, It saves as .ogg
- After camera record start it gives error as "CameraBin error: "Internal data stream error."
simultaneously on the console, I am getting "ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0" error. - As per your saying I have to write codec "imxvpuenc_h264". But I am confused that where to change it.
I have changed "x264enc" to "imxvpuenc_h264" in file qgstreamervideoencode.cpp. But, while recording It is not executing.
Thanks,
Nikita Panchal -
What do you mean by "not executing" ?
-
I have put "qDebug()" on it. It doesn't print on recording start.
-
Maybe a silly question but are you sure you replaced the plugin once you built it ?
-
Hi,
I have applied "0001-QCamera-can-t-set-recording-container-format-video-a.patch" patch from below link and it works for me.
"https://community.nxp.com/docs/DOC-330047"
Thanks for your support.