view gettimefromedls.py @ 133:0d8eabdd12ab default tip

create: write H:MM:SS timestamps, add option to fill with gaussian-blur instead of black many albums are longer than one hour so writing H:MM:SS is a necessity. if anything there will just be verbose info that isn't important for my use-case. however the gaussian-blur is simply broken. It works, and it plays locally just fine, but YouTube in particular elongates the video to fit the full width. I'm not entirely sure why it does this, but it makes it useless and ugly.
author Paper <paper@tflc.us>
date Sat, 03 Jan 2026 20:25:38 -0500
parents a972dc788da0
children
line wrap: on
line source

# get timestamps from Vegas EDL files
# used in my unfinished compilation
import sys
import os
import re

parsedfl = []

def main(argv):
    with open(argv[1]) as fl:
        next(fl)
        i = 0
        for line in fl.readlines():
            # I LOVE REGEX!!!
            match = re.search("\d+; \d+; (\d+\.\d+); \d+\.\d+; \d+\.\d+; .+?; .+?; \d+; .+?; .+?; .+?; \"(.+?)\";", line)
            if match:
                parsedfl.append(match.group(1, 2))
            i += 1
    for i in parsedfl:
        print("%d:%02d: %s" % (round(float(i[0]) / 1000) / 60, round(float(i[0]) / 1000) % 60, os.path.basename(i[1])))

if __name__ == "__main__":
    main(sys.argv)