IMX7 VideoCapture OpenCV

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX7 VideoCapture OpenCV

1,174 Views
sebastian_sedlm
Contributor I

Hi,

i try to read a Video with openCV.

This is the relevant Code:

#include <stdio.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <opencv2/videoio.hpp>

using namespace cv;
using std::string;

int main()
{
string filename = "testvideo.mp4";
VideoCapture capture(filename);
}

I am using the imx7 dual sabre board with the following image specs:

Kernel: L4.14.98

Distro: FSL-IMX-Wayland

FSL-Image.validation-imx

GCC-Compiler (7.3.0)

I get the following response:

====== AIUR: 4.4.5 build on Apr 24 2020 03:18:56. ======
Core: MPEG4PARSER_06.16.01 build on Dec 11 2018 03:04:05
file: /usr/lib/imx-mm/parser/lib_mp4_parser_arm11_elinux.so.3.2
------------------------
Track 00 [video_0] Enabled
Duration: 0:00:20.360000000
Language: und
Mime:
video/x-h264, parsed=(boolean)true, alignment=(string)au,
stream-format=(string)avc, width=(int)1920, height=(int)1080,
framerate=( fraction)25/1,
codec_data=(buffer)01640028ffe1001e67640028acd940780227e5c05a808080a0000003002000000641e30632c001000568e93b2c8bfdf8f800
------------------------ ------------------------
Track 01 [audio_0] Enabled
Duration: 0:00:20.436666000
Language: und
Mime:
audio/mpeg, mpegversion=(int)4, channels=(int)2,
rate=(int)48000, bitrate=(int)0, stream-format=(string)raw,
codec_data=(buffer)119 0 ------------------------ ====== BEEP: 4.4.5
build on Apr 24 2020 03:19:03. ======
Core: AAC decoder Wrapper build on Dec 7 2017 18:13:49
file: /usr/lib/imx-mm/audio-codec/wrap/lib_aacd_wrap_arm12_elinux.so.3
CODEC: BLN_MAD-MMCODECS_AACD_ARM_03.09.00_CORTEX-A8 build on Sep 20 2017
15:02:14.

At this point the program is stuck. 

I have already found some similar problems with the imx6.
However, I could not yet apply a meaningful solution.

In case this is an audio-only problem: Only video is relevant for the use case, audio is not needed. Is there a way to ignore this?

Best Regards

Sebastian

0 Kudos
4 Replies

1,097 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Sebastian,

You need to add the codec package in your repository, do not know exactly why are you receiving this errors because you are loading yocto with opencv 3 and you want to run opencv 2, but the MX7D will fail with G2D is not present is better try in openCV for  MX6.

https://community.nxp.com/thread/524527 

Regards

0 Kudos

1,097 Views
sebastian_sedlm
Contributor I

Hello Bio_TICFSL,

thanks for your answer.

I'm not sure I heard you right. 

you think the problem is in integrating opencv or the wrong version of it?

OpenCV works fine. I use it already for en/decode images. 

The problem occurs only with videos, I thought it was related to the missing VPU.

Unfortunately switching to the IMX6 is not an option, because other resources of the IMX7 are needed.

Best Regards

Sebastian

0 Kudos

1,097 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi,

The i.MX7 not have VPU neither GPU to support OpenCV, that´s the reason I mention the MX6.

Regards

0 Kudos

1,097 Views
sebastian_sedlm
Contributor I

Hi Bio_TICFSL,

That was also my level of knowledge.

I just wasn't sure about that.

Thanks for the help.

Best Regards

Sebastian

0 Kudos