Script to generate thumbnails of a video and combine into one tile image using ffmpeg and ImageMagick

This commit is contained in:
romanwarlock 2019-08-12 17:10:19 +02:00 committed by GitHub
parent a9d12698f1
commit cc30ec41fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

14
th.sh
View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# #
# #
# Dependencies: # Dependencies/Requirements:
# 1. ffmpeg # 1. ffmpeg
# 2. ImageMagick # 2. ImageMagick with modified policy.xml (avaliable on this git)
# #
# Usage: # Usage:
# ./th.sh NFRAMES TILE SIZE INPUT # ./th.sh NFRAMES TILE SIZE INPUT
@ -17,13 +17,7 @@
# exist). # exist).
# #
# Example: # Example:
# ./thumbnails.sh 16 4x4 1920 video.mp4 thumbnails.png # . th.sh 16 4x4 1920 video.mp4
#
# Credit:
# http://goo.gl/vzXW1b (FFmpeg wiki: generate thumbnails)
# http://stackoverflow.com/q/7395343 (extract video length)
# http://apple.stackexchange.com/q/52879 (combine images)
if [[ $# != 4 ]]; then if [[ $# != 4 ]]; then
echo "wrong number of arguments echo "wrong number of arguments
@ -39,7 +33,7 @@ OUTPUT is the path to the output file (make sure intermediate directories
exist). exist).
Example: Example:
./th.sh 16 4x4 1920 video.mp4 . th.sh 16 4x4 1920 video.mp4
" "
return 1 return 1
fi fi