Skip to content

Instantly share code, notes, and snippets.

@rubenkr
Created October 21, 2020 19:30
Show Gist options
  • Save rubenkr/42bbc4af4693bee516921a8295e6c196 to your computer and use it in GitHub Desktop.
Save rubenkr/42bbc4af4693bee516921a8295e6c196 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "$(date): Conversion-Script started with parameter path:{$1} filename:{$2}" >> /config/recordings.log
#newfile=$(cut -c -4 <<<"$1")
# Handle multiline Strings better
newfile=$(echo $1 | sed -e 's/\n*.mkv/.mp4/' | sed -e 's/ //')
command="/usr/bin/ffmpeg -i "$1" -c:v libx264 -crf 23 -c:a aac -movflags faststart "$newfile""
echo $command >> /config/recordings.log
$(command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment