My static website generator using poole https://www.xythobuz.de
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

video-thumb 974B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. if [ -z "$1" ]; then
  3. echo "No argument supplied"
  4. exit 1
  5. fi
  6. sdir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
  7. dir=$(dirname "${1}")
  8. video=$(basename -- "${1}")
  9. ext="${video##*.}"
  10. name="${video%.*}"
  11. thumb="${name}_thumb.png"
  12. poster="${name}_poster.png"
  13. tmp="${name}_tmp.png"
  14. echo $sdir
  15. echo "Directory : $dir"
  16. echo "Input file: $video"
  17. echo "Thumbnail : $thumb"
  18. echo "Poster : $poster"
  19. cd "$dir"
  20. echo ffmpeg -i $video -vf "select=eq(n\,0)" -n -update 1 -frames:v 1 $poster
  21. ffmpeg -i $video -vf "select=eq(n\,0)" -n -update 1 -frames:v 1 $poster
  22. echo convert "$poster" -auto-orient -thumbnail 300x300\> -strip "$tmp"
  23. convert "$poster" -auto-orient -thumbnail 300x300\> -strip "$tmp"
  24. echo convert $tmp \( $sdir/static/lg/video-play.png -background none -gravity center \) -composite $thumb
  25. convert $tmp \( $sdir/static/lg/video-play.png -background none -gravity center \) -composite $thumb
  26. echo rm -rf $tmp
  27. rm -rf "$tmp"