Add some scripts used in post-production
parent
cdfb87762a
commit
e627e6e002
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
# Requirements
|
||||||
|
|
||||||
|
- [ffmpeg](https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz)
|
||||||
|
|
||||||
|
# `audio.sh`
|
||||||
|
|
||||||
|
Normalise audio
|
||||||
|
|
||||||
|
```
|
||||||
|
Usage: ./audio.sh videofile
|
||||||
|
```
|
||||||
|
|
||||||
|
# `cutgui.sh`
|
||||||
|
|
||||||
|
Download and run LosslessCut in a temp directory
|
||||||
|
|
||||||
|
```
|
||||||
|
Usage: ./cutgui.sh
|
||||||
|
```
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
mode=loudnorm
|
||||||
|
|
||||||
|
file="$1"
|
||||||
|
outfile="${file%.*}.audiotweaked.${file##*.}"
|
||||||
|
|
||||||
|
if [[ -z "$file" ]]; then
|
||||||
|
echo "Usage: $0 videofile"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$mode" == "mean" ]]; then
|
||||||
|
# A simple way to detect mean_volume and use it to tweak the entire file
|
||||||
|
ffmpeg -i "$file" -filter:a volumedetect -f null /dev/null
|
||||||
|
read -p "Enter mean_volume: " volume
|
||||||
|
ffmpeg -i "$file" -filter:a "volume=$volume" -af "highpass=f=200, lowpass=f=3000" "$outfile"
|
||||||
|
elif [[ "$mode" == "loudnorm" ]]; then
|
||||||
|
# Use the recommended loudnorm filter
|
||||||
|
ffmpeg -i "$file" -vcodec copy -af "loudnorm" "$outfile"
|
||||||
|
else
|
||||||
|
echo "Unknown mode"
|
||||||
|
exit 1
|
||||||
|
fi
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
temp=/tmp/lossless-cut
|
||||||
|
download=https://github.com/mifi/lossless-cut/releases/download/v3.17.4/LosslessCut-linux.tar.bz2
|
||||||
|
|
||||||
|
mkdir -p "$temp"
|
||||||
|
|
||||||
|
if [[ ! -f "$temp/lossless-cut" ]]; then
|
||||||
|
echo "lossless-cut not found in $temp"
|
||||||
|
echo "Downloading lossless-cut..."
|
||||||
|
wget -nv --show-progress "$download" -O "$temp/archive.tar.bz2"
|
||||||
|
echo "Extracting lossless-cut..."
|
||||||
|
tar -xf "$temp/archive.tar.bz2" -C "$temp" --strip-components=1
|
||||||
|
echo "Successfully obtained lossless-cut"
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$temp/lossless-cut" "$@"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue