0

I'm new to python and as part of my project I need to find the fps of any video file.

Below is the code that I have so far that doesn't work.


filen = input('  Please enter the exact file name of the video, eg: video.mp4    ')

filename = ('"'+filen+'"')

print(filename)

clip = VideoFileClip(filename)

rate = clip.fps
  
print("FPS : " + str(rate))
  • Hi welcome to the site. Please provide the exact error message you're receiving along with the full stack trace – Abirbhav G. Oct 10 '22 at 05:17

1 Answers1

0

Your code is OK and returning what it is supposed to but the only logical problem you have in your code, you don't need to concatenate the double quotes with filename e.g. filename = ('"'+filen+'"') just skip this and you are good to go

from moviepy.editor import *

filen = input('  Please enter the exact file name of the video, eg: video.mp4    ')

print(filen)

clip = VideoFileClip(filen)

rate = clip.fps
  
print("FPS : " + str(rate))

enter image description here

Zain Ul Abidin
  • 2,467
  • 1
  • 17
  • 29