مرحبا..
لدي كود برمجي يستخرج صور من الفيديوهات يعمل دون مشاكل
لكن مااحتاجه هو الحصول على صورة كل 30 ثانية بدلا من كل 1 ثانية
# from video2images import Video2Images
import cv2
vcap = cv2.VideoCapture()
# set frame width and height
vcap.set(cv2.CAP_PROP_FRAME_WIDTH, 480)
vcap.set(cv2.CAP_PROP_FRAME_HEIGHT, 640)
vcap.open(100)
vs=cv2.VideoCapture('VideoDoor//aaa.mp4')###input
prop=cv2.CAP_PROP_FRAME_COUNT
total=int(vs.get(prop))
print(" [INFO] {} total frame in video".format(total))
ret, img=vs.read()
print(ret)
count=0
while ret:
cv2.imwrite("Images//frame%d.jpg" %count , img) ###output foldir
ret, img=vs.read()
print('Read a new frame:',count,ret)
count += 1