Skip to content

Instantly share code, notes, and snippets.

View avaidyam's full-sized avatar

Aditya Vaidyam avaidyam

View GitHub Profile
@avaidyam
avaidyam / BackdropView.swift
Created July 2, 2020 17:23
DIY NSVisualEffectView using Private API for macOS
// TODO: setting window transforms (or mission control) flattens layers...
// TODO: Mask image vs path (layer)?
/// `NSVisualEffectView`:
///
/// A view that adds translucency and vibrancy effects to the views in your interface.
/// When you want views to be more prominent in your interface, place them in a
/// backdrop view. The backdrop view is partially transparent, allowing some of
/// the underlying content to show through. Typically, you use a backdrop view
/// to blur background content, instead of obscuring it completely. It can also
#!/bin/bash
mkdir -p "$1_8mb"
cd $1
for x in *.mp4; do
newname=${x/mp4/8mb.mp4}
# if [[ "../$1_8mb/$newname" exists then skip ]]
/opt/homebrew/bin/ffmpeg -i "$x" -c:a copy -c:v libx264 -crf 35 -vf scale=1280:720 "../$1_8mb/$newname"
/opt/homebrew/bin/exiftool "-AllDates<Filename" "-FileCreateDate<Filename" "-FileModifyDate<Filename" -overwrite_original_in_place "../$1_8mb/$newname"
done