From 3692bd56b5061e23c89d4f41be29a3344826165d Mon Sep 17 00:00:00 2001 From: Antoine Van-Elstraete Date: Thu, 15 Apr 2021 16:20:39 +0200 Subject: [PATCH] Stabilisation --- vid_convert.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/vid_convert.py b/vid_convert.py index 90cdf31..a87a1cf 100755 --- a/vid_convert.py +++ b/vid_convert.py @@ -103,11 +103,20 @@ def volume_audio(file, infos): return volumes +def stabilization(file): + ''' + Cette fonction permet de stabiliser l'image, + par exemple quand filmé au smartphone. + ''' + cmd_stab = f'ffmpeg -i {file} -vf vidstabdetect=shakiness=10:accuracy=10:result="/tmp/vidstab.trf" -f null - ' + + if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() parser.add_argument("f_input") - parser.add_argument("-d", "--debug", dest='debug', action='store_true') + parser.add_argument("-d", "--debug", dest="debug", action="store_true") + parser.add_argument("-s", "--stabilise", dest="stab", action="store_true") args = parser.parse_args() if args.debug: logging.basicConfig(format='[%(asctime)s]\n%(message)s', level=logging.DEBUG, datefmt='%d/%m/%Y %H:%M:%S') @@ -117,3 +126,6 @@ if __name__ == '__main__': interlaced = is_interlaced(args.f_input, infos) cropsize = cropping(args.f_input, infos) volumes = volume_audio(args.f_input, infos) + if args.stab: + stabilization(f_input) +