Skip to content

Instantly share code, notes, and snippets.

@pog42
pog42 / attach subs and fonts.py
Last active March 29, 2021 14:51
Remuxing batch scripts for windows with ffmpeg and mkvtoolnix
import os,re,time,subprocess
folder2 = os.getcwd()
folderout = os.path.join(folder2, 'output')
mkvpaths = []
mkvnames = []
subpaths = []
fontpaths = []
#!/usr/bin/env python3
# combine adjacent lines with the same timecodes
import sys
from datetime import datetime, timedelta
def find_nth(string, substring, n, start=0):
"""find nth occurance of substring in string starting at position start.
(uses string.find) n starts at 1, start starts at 0"""
found = string.find(substring, start)