From 41f9fbdc7dd5119af3cd7d79174b1f88e321332c Mon Sep 17 00:00:00 2001 From: damaggu Date: Sat, 30 Nov 2019 18:06:46 +0100 Subject: [PATCH] automated video conversion and bugfixing --- behaviopy/computervision.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/behaviopy/computervision.py b/behaviopy/computervision.py index 11f0b9a..bf94995 100644 --- a/behaviopy/computervision.py +++ b/behaviopy/computervision.py @@ -4,7 +4,6 @@ import os import cv2 -import ffmpeg import numpy as np from skimage.feature import canny from skimage.filters import threshold_otsu @@ -26,7 +25,6 @@ 'nd750_a0082', 'nd750_a0083', 'nd750_a0084', - ### neue kamera 'nd750_a0087', 'nd750_a0088', 'nd750_a0089', @@ -226,10 +224,9 @@ def mkv_to_avi(self, videos, command = 'ffmpeg -i ' + video + ' -vf scale=256:-1 -b 512k -flags global_header -vcodec mpeg1video -acodec copy ' + avi_path + id + '.avi' - fixed_but_fugly = subprocess.run(command, - shell=True, - # Probably don't forget these, too - check=True, text=True) + res = subprocess.run(command, + shell=True, + check=True, text=True) pass @@ -295,11 +292,11 @@ def main(): 'distances': distances, 'speed': speed, 'inner_radius': inner_circle_radius, - 'example_frame' : frames[50], + 'example_frame' : frames[500], } np.save(results_path + filename + '_videoprocessing_results.npy', results) if __name__ == "__main__": - main() + main() \ No newline at end of file