I am trying to pull out information about the resolution of the video clip, but it gives an error. Help me figure out where the joint is. from subprocess import Popen, PIPE import re import ffmpeg
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("D:\Документы\проекты\заготовки\1.mp4") Gives out:
Traceback (most recent call last): File "D:/htpthd/bin/probnik/разрешение.py", line 15, in <module> getvideodetails("D:\Документы\проекты\заготовки\1.mp4") File "D:/htpthd/bin/probnik/разрешение.py", line 10, in getvideodetails if line.rfind("Video") > 0: TypeError: argument should be integer or bytes-like object, not 'str' Process finished with exit code 1