19 lines
489 B
Python
19 lines
489 B
Python
import os
|
|
import cv2
|
|
|
|
projectName = "Resolution checker.py"
|
|
outputFile = "output.txt"
|
|
|
|
output = ""
|
|
|
|
for file in os.listdir():
|
|
if file != projectName and file != outputFile:
|
|
vid = cv2.VideoCapture(file)
|
|
height = str(int(vid.get(cv2.CAP_PROP_FRAME_HEIGHT)))
|
|
width = str(int(vid.get(cv2.CAP_PROP_FRAME_WIDTH)))
|
|
output = output + (width + "x" + height + "\t" + file + "\n")
|
|
|
|
oFile = open(outputFile, "a")
|
|
oFile.write(output)
|
|
oFile.close()
|