Created
March 30, 2020 04:33
-
-
Save bhavaniravi/4c1017d4688ce4c40cfb77685e2aaa11 to your computer and use it in GitHub Desktop.
Find length of videos in a folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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