Hallo zusammen,
ich möchte über ein Python-Script die Dauer bzw. Länge eines ts-Videos ermitteln.
Hier mal ein Ausschnitt des Codes:
Dafür brauche ich allerdings ffprobe. Dies soll wohl eigentlich als Teil von ffmpeg installiert werden, was bei mir aber irgendwie nicht der Fall ist.
Ich habe FFmpeg 6 von Vincent Fortier auf meiner DS224+ installiert. Das Programm liefert allerdings folgenden Fehler:
Kann mir jemand vielleicht sagen wie ich entweder ffprobe zum Laufen bekomme oder wie ich alternativ die Dauer eines ts-Videos ermitteln kann?
ich möchte über ein Python-Script die Dauer bzw. Länge eines ts-Videos ermitteln.
Hier mal ein Ausschnitt des Codes:
Code:
def videoDuration(video_file_path):
"""Get video duration in sec from a ffprobe call, using json output"""
#command is: ffprobe -loglevel quiet -print_format json -show_format /full/path/to/videofile
command = ["ffprobe", "-loglevel", "quiet", "-print_format", "json", "-show_format ", video_file_path]
pipe = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out, err = pipe.communicate()
js = json.loads(out)
return int(float(js['format']['duration']) + 1.)
Dafür brauche ich allerdings ffprobe. Dies soll wohl eigentlich als Teil von ffmpeg installiert werden, was bei mir aber irgendwie nicht der Fall ist.
Ich habe FFmpeg 6 von Vincent Fortier auf meiner DS224+ installiert. Das Programm liefert allerdings folgenden Fehler:
Code:
FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe'