unable to write mp4 video using opencv

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

unable to write mp4 video using opencv

768件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

744件の閲覧回数
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 件の賞賛
返信

729件の閲覧回数
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