Answer the question
In order to leave comments, you need to log in
Python opencv2 fourcc codecs?
There is a code:
import cv2
v = cv2.VideoCapture("video.mp4")
o = cv2.VideoWriter('outpy.mp4',cv2.VideoWriter_fourcc('H','E','V','C'), 24, (int(v.get(3)),int(v.get(4))))
fs = int(v.get(cv2.CAP_PROP_FRAME_COUNT))
f = 0
print(fs)
while f < fs:
_,n = v.read()
o.write(n)
f += 1
v.release()
o.release()
OpenCV: FFMPEG: tag 0x34363248/'H264' is not supported with codec id 27 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'
Failed to load OpenH264 library: openh264-1.8.0-win64.dll
Please check environment and/or download library: https://github.com/cisco/openh264/releases
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question