Skip to content

Instantly share code, notes, and snippets.

View bradcordeiro's full-sized avatar

Brad Cordeiro bradcordeiro

View GitHub Profile
@bradcordeiro
bradcordeiro / DaVinciResolveTypes.lua
Last active April 8, 2024 15:10
Lua Language Server Definition File for DaVinci Resolve 18 Lua Scripting API
---@meta
---@alias Base64Data string Property of ThumbnailData type but otherwise undocumented
---@alias FusionComp unknown Return or argument type for some TimelineItem methods but otherwise undocumented
---@alias GalleryStill unknown Return or argument type for GalleryStillAlbum methods but otherwise undocumented
---@alias TimelineExportAAFSubType unknown Probably an enum but undocumented, optional argument for Timeline.Export
---@alias TimelineExportEDLSubType unknown Probably an enum but undocumented, optional argument for Timeline.Export
---@alias TimelineExportSubType TimelineExportAAFSubType | TimelineExportEDLSubType
---@alias TimelineExportType unknown Probably an enum but undocumented, argument for Timeline.Export
@bradcordeiro
bradcordeiro / DaVinciResolve.d.ts
Last active February 13, 2024 13:44
DaVinci Resolve 18 Javascript API TypeScript Types
/*
Copyright 2022 Brad Cordeiro
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
@bradcordeiro
bradcordeiro / resolve-project-server-start.sh
Last active April 8, 2024 15:01
Run a DaVinci Resolve Projects Server in a Docker Container
docker run \
--name resolve_project_server \
-p 5432:5432 \
-v resolve_projects_data:/var/lib/postgresql/data \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=DaVinci \
-e POSTGRES_HOST_AUTH_METHOD=md5 \
-d \
postgres:13
@bradcordeiro
bradcordeiro / SearchDB.txt
Created May 9, 2018 21:11
Avid Media Composer _SearchDB_ Schema
CREATE TABLE preference ( -- Table of DB preference for project.
key TEXT UNIQUE, -- Unique string identifier
value TEXT NOT NULL -- Preference value.
);
CREATE TABLE host ( -- Table of all hosts for project.
id INTEGER PRIMARY KEY AUTOINCREMENT, -- Unique identifier within the database.
name TEXT UNIQUE -- Unique string identifier
);
@bradcordeiro
bradcordeiro / transcode_for_avid.sh
Created February 21, 2018 21:09
FFmpeg Command to Transcode DNxHR for Avid Media Composer
# Change number following -profile:v to encode different flavors of DNxHR
# 1: DNxHR 444
# 2: DNxHR HQX
# 3: DNxHR HQ
# 4: DNxHR SQ
# 5: DNxHR LB
ffmpeg -i ${INPUT} -c:v dnxhd -profile:v 3 -c:a pcm_s24le ${OUTPUT}
@bradcordeiro
bradcordeiro / ltfs2rsync
Last active May 9, 2018 21:13
Use xmlstarlet, bash sort, and awk to sort files from an LTFS schema by position on tape and write it to a text file suitable for rsync's --files-from
xml sel -t -m ".//file" -v "extentinfo/extent[1]/startblock" -o ",\"" \
-v name -o "\",\"" -m "ancestor-or-self::directory" -v "name" -o "/" -b \
-o "\"" -n ${INPUT_FILE} | sort -n | awk -F',' '{gsub(/"/,"");print $3 $2}'
@bradcordeiro
bradcordeiro / mimic.sh
Created June 1, 2017 22:38
Copy directory structure and file names without file content
find . -type d -exec mkdir -p destination/"{}" ;
find . -type f -exec touch destination/"{}" ;
@bradcordeiro
bradcordeiro / ltfs2csv.sh
Created May 16, 2017 20:34
Print file information from LTFS index schema to CSV format using xmlstarlet
VOLUME_UUID=$(xmlstarlet sel -t -m "/ltfsindex" -v volumeuuid "${1}")
VOLUME_NAME=$(xmlstarlet sel -t -m "/ltfsindex" -v directory[1]/name "${1}")
xmlstarlet sel -t -m ".//file" \
-o "${VOLUME_UUID}" -o "," \
-o "${VOLUME_NAME}" -o "," \
-v "extentinfo/extent[1]/startblock" -o "," \
-v name -o "," \
-v "length" -o "," \
-m "ancestor-or-self::directory" -v "name" -o "/" -b -o "," \