Skip to content

Instantly share code, notes, and snippets.

@nevadajames
Created March 21, 2019 14:19
Show Gist options
  • Select an option

  • Save nevadajames/615e8d5b8f1541bf008918845bce66d6 to your computer and use it in GitHub Desktop.

Select an option

Save nevadajames/615e8d5b8f1541bf008918845bce66d6 to your computer and use it in GitHub Desktop.
Check video length python script
#!/usr/bin/env python
from ffprobe import FFProbe
import glob, os
os.chdir("/downloads")
for file in glob.glob("*.avi"):
metadata=FFProbe(file)
for stream in metadata.streams:
if stream.isVideo():
print("Stream contains "+stream.frames()+" frames.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment