Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo -e "Usage: this-script.sh <soundpost>"
- soundpost=$1
- soundpostfilename=${soundpost##*'/'}
- afterdot=${soundpostfilename##*'.'}
- name=${soundpostfilename%%'['*}
- beforebracket=${soundpostfilename%%']'*}
- soundsource=${beforebracket##*'['}
- link=$(echo "$soundsource" | tail -c +7 | sed 's|%2F|/|g')
- sourceafterdot=${link##*'.'}
- soundfile="/tmp/soundsource.$sourceafterdot"
- echo "Sound source located as $link"
- wget "$link" -O "$soundfile"
- if [ "$afterdot" == "gif" ]; then
- ffmpeg -stream_loop -1 -i "$soundpost" -i "$soundfile" -shortest -c:v libvpx-vp9 -c:a libopus "$name.webm"
- elif [ "$afterdot" == "png" ] || [ "$afterdot" == "jpeg" ] || [ "$afterdot" == "jpg" ]; then
- ffmpeg -i "$soundpost" -i "$soundfile" -c:a libopus "$name.webm"
- else
- ffmpeg -i "$soundpost" -i "$soundfile" -c:v copy -c:a libopus "$name.$afterdot"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement