Skip to content

Instantly share code, notes, and snippets.

View nickferrando's full-sized avatar
💭
I may be slow to respond.

Nick Ferrando nickferrando

💭
I may be slow to respond.
View GitHub Profile
@nickferrando
nickferrando / imagemagick-ubuntu18.txt
Last active May 9, 2020 13:03
Install ImageMagick on Ubuntu 18.04 LTS
#Install ImageMagick on Ubuntu 18.04 LTS
sudo apt update
sudo apt upgrade -y
sudo reboot
sudo apt --purge autoremove
#Install Build-Essential in order to configure and make the final Install
sudo apt-get install build-essential
@nickferrando
nickferrando / multiaudio.sh
Created May 9, 2020 19:32
Convert WAV files into Multiple Audio Formats
#!/bin/bash
#Convert input files in .WAV format to multiple destinations
#AIFF, Mp3 @64Kbps, Mp3 @128Kbps, AAC @192k and FLAC format.
#It will also copy the metadata informations, where they exists.
mkdir aiff mp3-64 mp3-128 aac-192 flac
for i in *.wav; do ffmpeg -i "$i" -nostdin -map_metadata:s:a 0:s:a "./aiff/${i%.*}.aiff" -b:a 64k "./mp3-64/${i%.*}.mp3" -b:a 128k "./mp3-128/${i%.*}.mp3" -b:a 192k "./aac-192/${i%.*}.aac" "./flac/${i%.*}.flac"
done
@nickferrando
nickferrando / wavtoflac.sh
Last active May 9, 2020 20:59
FFMPEG WAV to FLAC Batch Formula [Ubuntu]
#!/bin/bash
#This script creates a new folder named "processed" in the working directory,
#then finds every file with .WAV extension and convert it to FLAC (Free Lossless Audio Codec).
#It also copy the metadata informations associated with the input (where they exists) to the output.
mkdir processed
for i in *.wav
do ffmpeg -i "$i" -nostdin -map_metadata:s:a 0:s:a -c:a flac "./processed/${i%.*}.flac"
done
@nickferrando
nickferrando / logoresize.sh
Last active May 11, 2020 14:37
Proportional Resizing Overlays with ImageMagick
#!/bin/bash
#Make sure to replace "YOURPATH" with your logo/graphic overlay path, on line 5.
for f in *.png *.jpg
do magick $f -set option:sz "%[fx:min(w,h)*20/100]" \
\( YOURPATH -resize "%[sz]" \) \
-alpha on -channel rgba -gravity northeast \
-define compose:args=50,100 -composite $f
done
@nickferrando
nickferrando / ffmpeg-normalize-google.sh
Last active May 11, 2020 17:40
FFMPEG-Normalize - Parameters for Loudness Normalization for Google Assistant (Standard EBU R128)
#!/bin/bash
#This FFMPEG-Normalize command produce a standard volume normalization, as per Google technical specifications:
#(https://developers.google.com/assistant/tools/audio-loudness).
#Please note that you need to install FFMPEG before installing FFMPEG-Normalize.
ffmpeg-normalize [INPUT] -nt ebu -t "-16" -lrt "11" -tp "-1.5" --offset "-0.5" -ar 192000 -v -o [OUTPUT]
@nickferrando
nickferrando / multiloudnorm.sh
Last active May 11, 2020 17:41
WAV to Multiple Audio Formats with EBU R128 Loudness Normalization
#!/bin/bash
#Convert input files in .WAV format to multiple destinations
#AIFF, Mp3 @64Kbps, Mp3 @128Kbps, AAC @192k and FLAC format.
#It will also copy the metadata informations, where they exists.
mkdir aiff mp3-64 mp3-128 aac-192 flac
for i in *.wav; do ffmpeg -i "$i" -nostdin -map_metadata:s:a 0:s:a -af loudnorm "./aiff/${i%.*}.aiff" -b:a 64k "./mp3-64/${i%.*}.mp3" -b:a 128k "./mp3-128/${i%.*}.m$
done
@nickferrando
nickferrando / ffmpeg-normalize-amazon.sh
Last active May 11, 2020 17:43
FFMPEG-Normalize - Parameters for Loudness Normalization for Amazon Alexa (Standard EBU R128)
#!/bin/bash
#This FFMPEG-Normalize command will produce a standard loudness normalization
#as per Amazon Alexa Technical Documentation (https://developer.amazon.com/it-IT/docs/alexa/flashbriefing/normalizing-the-loudness-of-audio-content.html)
ffmpeg-normalize [INPUT].wav -nt ebu -t "-14" -lrt "11" -tp "-3" -ar 44100 -v -o [OUTPUT].wav
@nickferrando
nickferrando / pdf-optimize.sh
Created June 1, 2020 17:22
PDF Optimizer with Ghostscript
gs \
-o OUTPUT.pdf \
-sDEVICE=pdfwrite \
-dDownsampleColorImages=true \
-dDownsampleGrayImages=true \
-dDownsampleMonoImages=true \
-dColorImageResolution=72 \
-dGrayImageResolution=72 \
-dMonoImageResolution=72 \
-dColorImageDownsampleThreshold=1.0 \
@nickferrando
nickferrando / Bento4-Ubuntu-Install.sh
Last active June 23, 2023 00:02
Installing Bento4 Tools for Ubuntu
#Install Git
sudo apt update
sudo apt install git
#Git Clone Bento4
git clone https://github.com/axiomatic-systems/Bento4.git
cd Bento4/
@nickferrando
nickferrando / bash-ffmpeg-multiple-io.sh
Created August 24, 2023 01:23
BASH Automation for FFmpeg processing, with Multiple Files Input and Separate Directories Output
#!/bin/bash
#This script will process each file in a given input directory
#and will create a corresponding output folder for each processed file.
# Input and output directories
input_dir="/your/input/directory"
output_dir="output_folder"
# Create the output directory if it doesn't exist