Skip to content

Instantly share code, notes, and snippets.

@bhavaniravi
Created March 30, 2020 04:33
Show Gist options
  • Save bhavaniravi/4c1017d4688ce4c40cfb77685e2aaa11 to your computer and use it in GitHub Desktop.
Save bhavaniravi/4c1017d4688ce4c40cfb77685e2aaa11 to your computer and use it in GitHub Desktop.
Find length of videos in a folder
from mutagen.mp4 import MP4
duration = 0
for file in os.listdir():
mp4 = MP4(file)
duration += mp4.info.length
print (duration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment