Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
import cv2
file_path = "./video.avi"
vid = cv2.VideoCapture( file_path )
height = vid.get(cv2.CAP_PROP_FRAME_HEIGHT)
width = vid.get(cv2.CAP_PROP_FRAME_WIDTH)
from subprocess import Popen, PIPE
import re
def getvideodetails(filepath):
cmd = 'ffmpeg -i %s" % filepath'
p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
di = p.communicate()
for line in di:
if line.rfind("Video") > 0:
resolution = re.findall("(\d+x\d+)", line)[0]
return resolution
getvideodetails("путь к видео")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question