I am trying to extract the frames from video , I have to pass the video (mp4) to deep learning model . I have successfully runs it on the gif but working on videos .
Code for gif:
image_path = 'video.gif'
image = tf.io.read_file(image_path)
image = tf.image.decode_gif(image)
print(image.shape)
Output:
TensorShape([30, 640, 352, 3]) #(num_frames, height, width, channels)
I have to pass the video like mp4 to model and some pre defined function should returns the same thing as above code is returning . Any pre defined function is available which should returns the output with (num_frames, height, width, channels) , if I pass any video ?