Guest User

Untitled

a guest
Aug 17th, 2019
56
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #derived from creator: relaxed at freenode 's #ffmpeg
  3.  
  4. image_array=(*.jpg)
  5.  
  6. strStart="ffmpeg"
  7. strInput=""
  8. strFilter=""
  9. strEnd="concat=n=${#image_array[@]}:v=1:a=0,format=yuv420p[v]\" -map \"[v]\" out.mp4"
  10.  
  11.  
  12. # build input string
  13. for i in ${image_array[@]}; do
  14. strInput="$strInput -loop 1 -t 5 -i $i"
  15. done
  16.  
  17.  
  18. strInput="$strInput -filter_complex"
  19.  
  20. # build filter string
  21. for (( x=0; x<${#image_array[@]}; x++ )); do
  22. if [[ $x == 0 ]];then
  23. strFilter="\"[0:v]fade=t=out:st=3:d=0.25:alpha=1[v0];"
  24. else
  25. 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"];"
  26. fi
  27. strNumber="$strNumber[v"$x"]"
  28. done
  29.  
  30. # view the command
  31. echo "Running ==> $strStart $strInput $strFilter $strNumber $strEnd"
  32. echo
  33. echo
  34.  
  35. # run built command
  36. bash -c "$strStart $strInput $strFilter $strNumber $strEnd"
RAW Paste Data