サンプル1
動画ファイルを表示させる
import cv2
src = cv2.VideoCapture( r"C:\Users\kobay\Documents\py\outFN.mp4")
while True:
retval, frame = src.read()
# 最後まできた
if frame is None:
break
key = cv2.waitKey(0)
img_in = cv2.resize( frame, (int(w*0.5), int(h*0.5)))
img_out2 = cv2.resize( img_out, (int(w*0.5), int(h*0.5)))
cv2.imshow(self.windowName_in, img_in)
cv2.imshow( "windowName", img_in )
self.play_obj.stop()
dispGamen( self.start_frame )
key = cv2.waitKey( 0 )
pt = self.src.get(cv2.CAP_PROP_POS_FRAMES)
pt0 = (pt/20) *1000
sound = sound0[ pt0: ]
self.play_obj = sa.play_buffer(
sound.raw_data,
num_channels=sound.channels,
bytes_per_sample=sound.sample_width,
sample_rate=sound.frame_rate
)
0 件のコメント:
コメントを投稿