Skip to content

Instantly share code, notes, and snippets.

@protrolium
Last active September 11, 2022 15:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protrolium/a20be08726dffe563ba435c8d55a5103 to your computer and use it in GitHub Desktop.
Save protrolium/a20be08726dffe563ba435c8d55a5103 to your computer and use it in GitHub Desktop.
bash scripts

$ cd /usr/local/bin
$ sudo nano [scriptname]

#!/bin/bash
command goes here

exit and save

sudo chmod +x [scriptname] to make executable

we're done!

some new commands

yt [url] (youtube-dl ffmpeg merge best)
addac [file-format] (cd into dir for ffmpeg loop to convert files ready for ADDAC111)
syncDocuments (sophrosyne --> teuton)
syncAbleton (samizdat --> koloss)
vf [ss (offset)][filename][outputFileName] (extract jpg from video file with seconds offset specified)
audioExcerpt [file-format] [-ss offset] [-t time-length] (batch audio file excerpt creation for ADDAC111)
mp3 [input-filename] [bitrate e.g. 192k] [filename w/o ext] (create mp3)
flac [input-filename] [filename w/o ext] (create flac)

example of multistep command

$ subdiv $1 $2
(to subdivide and audio track and then create fades on each subdivision, then delete the original unfiltered segments).
$1 = filename, $2 = segment time in seconds

#!/bin/bash
mkdir segments
ffmpeg -i $1 -f segment -segment_time 1 -c copy segments/out%03d.wav
cd segments
for i in *.wav; do ffmpeg -i "$i" -c pcm_s16le -af "afade=t=in:st=0:d=0.05,afade=t=out:st=0.9:d=0.1" "${i%.wav}-fade.wav"; done
find . -type f \! -name "*fade*" -exec rm {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment