diff options
author | Sanmugasundaram K | 2015-01-08 12:32:18 +0530 |
---|---|---|
committer | Sanmugasundaram K | 2015-01-08 12:32:18 +0530 |
commit | 293af4fcc716fba56f26f3490443b6ba3ff2c440 (patch) | |
tree | 20e9ac8859bdd39ef741c9b28960e04727db9056 /website/helpers.py | |
parent | 2ae49074f030b61088317526b023b9e21124dbfc (diff) | |
download | spoken-tutorial-forums-293af4fcc716fba56f26f3490443b6ba3ff2c440.tar.gz spoken-tutorial-forums-293af4fcc716fba56f26f3490443b6ba3ff2c440.tar.bz2 spoken-tutorial-forums-293af4fcc716fba56f26f3490443b6ba3ff2c440.zip |
all tables linked with new website
Diffstat (limited to 'website/helpers.py')
-rw-r--r-- | website/helpers.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/website/helpers.py b/website/helpers.py index bf5217b..25ee1e7 100644 --- a/website/helpers.py +++ b/website/helpers.py @@ -8,11 +8,10 @@ def get_video_info(path): import subprocess import re - process = subprocess.Popen(['/usr/bin/ffmpeg', '-i', path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + process = subprocess.Popen(['/usr/bin/avconv', '-i', path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, stderr = process.communicate() duration_m = re.search(r"Duration:\s{1}(?P<hours>\d+?):(?P<minutes>\d+?):(?P<seconds>\d+\.\d+?)", stdout, re.DOTALL).groupdict() info_m = re.search(r": Video: (?P<codec>.*?), (?P<profile>.*?), (?P<width>.*?)x(?P<height>.*?), ", stdout, re.DOTALL).groupdict() - hours = Decimal(duration_m['hours']) minutes = Decimal(duration_m['minutes']) seconds = Decimal(duration_m['seconds']) @@ -26,8 +25,6 @@ def get_video_info(path): info_m['minutes'] = minutes info_m['seconds'] = seconds info_m['duration'] = total - info_m['width'] = int(info_m['width']) - info_m['height'] = int(info_m['height']) return info_m def prettify(string): |