Objective :
Creating video preview picture and contact sheet that can be used for JW Player and Time Slider Tooltip Plugin under linux environment (console) .
Tools :
First we'll extract thumbnail from the video using ffmpeg, then those images combined in 5x5 tiles that produce 25 pictures in single canvas using montage from imagemagick (without frame etc). Each tumbnails are 108x60, these combination will produce 540x300 canvas.
How to Use :
# sh ./thumbgen.sh convert_me.mp4 1 120
convert_me.mp4 --> file name
1 --> create video tumbnails every 1 sec
1 --> create video tumbnails every 1 sec
120 --> create video preview image at 120 sec
these are the commands :
#!/bin/sh# Script untuk membuat preview image dan contact sheet image dari video# untuk digunakan di JW Player dan Tooltip Plugin# digitalismic.blogspot.com | modification are welcomefile=$1# membuang ekstension sehingga nama file dapat digunakan sebagai identifikasi unik# setiap file yang digeneratefile_name=`echo "$file" | sed 's/....$//'`# membuat preview image pada detik x (input ke-3), dengan ukuran 854x480ffmpeg -y -itsoffset -$3 -i $file -vcodec mjpeg -vframes 1 -an -f rawvideo -s 854x480 preview-$file_name.jpg# membuat thumbnails temporary untuk membuat contact sheet dengan ukuran 108x60ffmpeg -i $file -vcodec mjpeg -vf fps=fps=1/$2 -s 108x60 thumb-$file_name-%05d.jpgechoecho "---------------------------------------"count_thumbs=`find ./ -name "thumb-$file_name-*" | wc -l`echo Finish Generate prewiew image at position $3-sececho Finish Generating $count_thumbs Tumbnailsecho Now Start To Create Contact Sheet "(5x5)"echo "---------------------------------------"# membuat contact sheet dengan ukuran 5x5montage thumb-$file_name-*.jpg -tile 5x5 -geometry 108x60+0+0 contact-sheet-$file_name-%05d.jpgecho Removing Generated Tumbnails# karena sudah tidak diperlukan, maka semua file thumbnail di deleterm -f thumb-$file_name-*.jpgecho Finished
example result (contact sheet):
Tidak ada komentar:
Posting Komentar