From 4e5c76b639a32cca3699c552c0a03e92fadafa21 Mon Sep 17 00:00:00 2001 From: Yuuki Chan Date: Sun, 26 Feb 2023 20:36:43 +0900 Subject: [PATCH] Added VapourSynth script. --- VapourSynth/bookmarks_to_avs_trims.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 VapourSynth/bookmarks_to_avs_trims.py diff --git a/VapourSynth/bookmarks_to_avs_trims.py b/VapourSynth/bookmarks_to_avs_trims.py new file mode 100644 index 0000000..6a91304 --- /dev/null +++ b/VapourSynth/bookmarks_to_avs_trims.py @@ -0,0 +1,20 @@ +"""bookmarks_to_avs_trimps.py: generates Avisynth trims from VapourSynth Bookmarks.""" + +__author__ = "Yuuki-chan" +__copyright__ = "Copyright 2022, Raiza.dev" + + +import sys + + +if sys.argv[1].endswith('.bookmarks'): + trimz = [] + + with open(sys.argv[1], mode='r') as ff: + trims = ff.read().split(', ') + + for trim in range(0, len(trims), 2): + trimz.append(f'Trim({trims[trim]}, {trims[trim+1]})') + + with open(f'{sys.argv[1]}.trims.txt', mode='w') as ff: + ff.write('++'.join(trimz))