Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- height=""
- if [[ -z "$1" ]]; then
- echo "picture height music length start"
- exit
- fi
- if [[ -n "$2" ]]; then
- # height="-vf scale -2:$2"
- height="-vf scale=trunc(oh*a/2)*2:$2"
- else
- height="";
- fi
- if [[ -n "$5" ]]; then
- start_time="-ss $3"
- else
- start_time="-ss 0:00";
- fi
- if [[ -n "$4" ]]; then
- length="-t $4"
- else
- length="";
- fi
- if [[ "${1##*.}" == "gif" ]]; then
- ffmpeg -ignore_loop 0 $start_time $length -i "$1" -i "$3" -map 0:v -map 1:a -acodec libvorbis -vcodec libvpx -b:v 200K -b:a 144k -pix_fmt yuv420p -shortest -metadata title="$3" "$3".webm
- exit
- fi
- ffmpeg -r 1 -loop 1 $start_time $length -i "$1" -i "$3" -map 0:v -map 1:a -acodec libvorbis -vcodec libvpx -b:v 0 -crf 16 -g 360 $height -pix_fmt yuv422p10le -shortest -metadata title="$3" "$3".webm
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement