Created
April 10, 2020 21:44
-
-
Save dillonchr/378ac95fa362b49486b7d077dfd30b39 to your computer and use it in GitHub Desktop.
OBS records MKVs right? Well this zips them into one MKV for easy YouTubin'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage: ./mkvjoin.sh "2020-04-03" | |
# then all recordings in the current dir with that file prefix (PREFIX*.mkv) | |
# will be ffmpeg'd into a single mkv stream without conversion so it's fast | |
# | |
# usage: ./mkvjoin.sh | |
# no arg will cause it to use today's date | |
# tested on macOS 10.15.3 (Catalina) heh | |
if [ -z "$1 " ] | |
then | |
today=$(date '+%Y-%m-%d') | |
else | |
today=$1 | |
fi | |
file="$today.txt" | |
if [ -f "$file" ]; then | |
rm $file | |
fi | |
touch $file | |
find $today*.mkv -print0 | | |
while IFS= read -r -d '' line; do | |
echo "file '$line'" >> $file | |
done | |
cat $file | |
ffmpeg -f concat -safe 0 -i $file -c copy "$today.mkv" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment