unable to write mp4 video using opencv

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

unable to write mp4 video using opencv

1,297 Views
john_wick
Contributor II

I am trying to write a mp4 video file on imx8m mini using opencv library. I am using ov5647 camera module.

Below is the code I am using to write video.

john_wick_0-1613735479372.png

However, after I run this program, there is not test.mp4 file created at all. 
I have also tried fourcc's *H264 also, but the result is same.

Please suggest. Thanks in advance.

Labels (1)
0 Kudos
Reply
2 Replies

1,273 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

 

You must add return value judgment as you don't know if the camera has been opened.

Can you provide the log when you run this test?

 

BR

Zhiming

0 Kudos
Reply

1,258 Views
john_wick
Contributor II

Hi Zhiming,

Thanks for your response.

The return value of cap.isOpened was True, and also cap.read() also returns True.

 

However, this problem is now solved for me.

I understood that codecs were missing on the board to write mp4 video file.

I have added ffmpeg in local.conf file, and compiled the image.

After deploying, opencv was able to detect ffmpeg and now I am able to write mp4 video files.

 

Thanks