import cv
import os
import sys
f = open('./Sites/a.html', 'w')
n=0
file_list=os.listdir("/Volumes/a/new/")
for file in file_list:
capture=cv.CaptureFromFile("/Volumes/a/new/"+file)
cv.SetCaptureProperty(capture,cv.CV_CAP_PROP_POS_FRAMES,1000)
image=cv.QueryFrame(capture)
cv.SaveImage("./Sites/img/"+str(n)+"_0.jpg ",image)
capture=cv.CaptureFromFile("/Volumes/a/new/"+file)
cv.SetCaptureProperty(capture,cv.CV_CAP_PROP_POS_FRAMES,2000)
image=cv.QueryFrame(capture)
cv.SaveImage("./Sites/img/"+str(n)+"_1.jpg ",image)
capture=cv.CaptureFromFile("/Volumes/a/new/"+file)
cv.SetCaptureProperty(capture,cv.CV_CAP_PROP_POS_FRAMES,3000)
image=cv.QueryFrame(capture)
cv.SaveImage("./Sites/img/"+str(n)+"_2.jpg ",image)
capture=cv.CaptureFromFile("/Volumes/a/new/"+file)
cv.SetCaptureProperty(capture,cv.CV_CAP_PROP_POS_FRAMES,4000)
image=cv.QueryFrame(capture)
cv.SaveImage("./Sites/img/"+str(n)+"_3.jpg ",image)
f.write('<img src="./img/'+str(n)+'_0.jpg " width=200><img src="./img/'+str(n)+'_1.jpg " width=200><img src="./img/'+str(n)+'_2.jpg " width=200><img src="./img/'+str(n)+'_3.jpg " width=200><br>'+file+'<br>')
n+=1
f.close()
Recommended Posts