Skip to content

Instantly share code, notes, and snippets.

@schiffty
schiffty / EdlToSubcap.js
Created October 19, 2022 06:54
EDL parsing function for separating events, and then locators, ending up in a new array that has only events with locators
parseEDL: function() {
this.resetPanel();
//Output array: 1-In TC 2-Out TC 3-Color 4-Text
var matches,locators, i=0;
var eventregex = /(\d{3}[^\n]*([0-9:]{11})\s([0-9:]{11})\s?\n[\s\S]*?(?=^\d{3}|^>|^$))/gim;
var locatorsregex = /\* ?LOC.*[\d:]{10,11}\s+([\w]+) +([^\r\n]*?)\r?\n/gi;
var input_content = this.input.contents + "\n";
@schiffty
schiffty / frames_to_TC.py
Last active July 27, 2021 06:00
Frames to Timecode in Python
def frames_to_TC (frames):
h = int(frames / 86400)
m = int(frames / 1440) % 60
s = int((frames % 1440)/24)
f = frames % 1440 % 24
return ( "%02d:%02d:%02d:%02d" % ( h, m, s, f))
# Breakdown of the steps above:
# Hours: Divide frames by 86400 (# of frames in an hour at 24fps). Round down to nearest integer.
@schiffty
schiffty / keybase.md
Created August 22, 2016 19:36
Keybase proof

Keybase proof

I hereby claim:

  • I am schiffty on github.
  • I am schiffty (https://keybase.io/schiffty) on keybase.
  • I have a public key ASAzbtvsnzIm1ksG_hdNSmFOSjbOxcwacpnBUaOOBrKqfwo

To claim this, I am signing this object: