Writing an mp4 video using python opencv

前端 未结 10 712
Happy的楠姐
Happy的楠姐 2021-01-31 07:44

I want to capture video from a webcam and save it to an mp4 file using opencv. I found example code on stackoverflow (below) that works great. The only hitch is that I\'m trying

10条回答
  •  故里飘歌
    2021-01-31 08:25

    There are some things to change in your code:

    1. Change the name of your output to 'output.mp4' (change to .mp4)
    2. I had the the same issues that people have in the comments, so I changed the fourcc to 0x7634706d: out = cv2.VideoWriter('output.mp4',0x7634706d , 20.0, (640,480))

提交回复
热议问题