hi folks, i need to get the video duration in python (django), the video formats that i need to get are mp4, flv, avi, mov... I have a shared hosting so i have no ffmpeg support.
Thanks!
sorry for my english.
hi folks, i need to get the video duration in python (django), the video formats that i need to get are mp4, flv, avi, mov... I have a shared hosting so i have no ffmpeg support.
Thanks!
sorry for my english.
You'll probably need to invoke an external program, ffprobe
can provide you with that information
import subprocess
def getLength(filename):
result = subprocess.Popen(["ffprobe", filename],
stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
return [x for x in result.stdout.readlines() if "Duration" in x]