IOStream-OpenEnd / MagikMoments

Finds the "magic" and the most happy moments of a given movie and makes a trailer out of it
GNU General Public License v3.0
12 stars 6 forks source link

Gather video frames from video for emotion recon #5

Closed supragya closed 5 years ago

supragya commented 5 years ago

@Kogam22 says - I found cv2 module that converts (.mp4)vidoes to frames. Check this out : https://stackoverflow.com/a/33399711/8690463

1ycx commented 5 years ago

I followed the stackoverflow answer and it gives me frames as the output.

import cv2
vidcap = cv2.VideoCapture('SampleVideo_1280x720_2mb.mp4')
success,image = vidcap.read()
count = 0
while success:
  cv2.imwrite("frames/frame%d.jpg" % count, image)     # save frame as JPEG file      
  success,image = vidcap.read()
  print('Read a new frame: ', success)
  count += 1
shubham-chhimpa commented 5 years ago

https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html

1ycx commented 5 years ago

This is also implemented.