Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #derived from creator: relaxed at freenode 's #ffmpeg
- image_array=(*.jpg)
- strStart="ffmpeg"
- strInput=""
- strFilter=""
- strEnd="concat=n=${#image_array[@]}:v=1:a=0,format=yuv420p[v]\" -map \"[v]\" out.mp4"
- # build input string
- for i in ${image_array[@]}; do
- strInput="$strInput -loop 1 -t 5 -i $i"
- done
- strInput="$strInput -filter_complex"
- # build filter string
- for (( x=0; x<${#image_array[@]}; x++ )); do
- if [[ $x == 0 ]];then
- strFilter="\"[0:v]fade=t=out:st=3:d=0.25:alpha=1[v0];"
- else
- strFilter="$strFilter ["$x":v]fade=t=in:st=3:d=0.25:alpha=1,fade=t=out:st=6:d=0.25:alpha=1[v"$x"];"
- fi
- strNumber="$strNumber[v"$x"]"
- done
- # view the command
- echo "Running ==> $strStart $strInput $strFilter $strNumber $strEnd"
- echo
- echo
- # run built command
- bash -c "$strStart $strInput $strFilter $strNumber $strEnd"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement