hits descr_cache futureuse
local ID NAME DESCRIPTION RESX RESY LENGTH COVER STATUS UPLOADER HITS \
DESCR_CACHE FUTUREUSE
- local arg video thumb
+ local arg video thumb cnt
video="${_DATA}/${CHANNEL_ID}/${VIDEO_ID}.mp4"
thumb="${_DATA}/${CHANNEL_ID}/${VIDEO_ID}_thumb.jpg"
resy="${arg#*height=}"; resy="${resy%%${BR}*}"
length="${arg#*duration=}"; length="${length%%${BR}*}"
fi
- if [ "$length" -a ! "${thumb}" -nt "${video}" ]; then
- ffmpeg -nostdin -y -i "$video" -vf scale=320:-2,fps=10/${length} "${thumb%.jpg}_%02d.jpg"
- montage "${thumb%.jpg}_"[01][0-9].jpg -tile 10x1 -geometry 320x180+0+0 -quality 85 "${thumb}"
- rm -- "${thumb%.jpg}_"[01][0-9].jpg
- fi 2>&-
+ if [ "${length%.*}" -a ! "${thumb}" -nt "${video}" ]; then
+ for cnt in 1 2 3 4 5 6 7 8 9 10; do
+ ffmpeg -nostdin -y -ss "$((cnt * ${length%.*} / 11))" -i "$video" \
+ -frames 1 "${thumb%.jpg}_$((cnt - 1)).jpg"
+ done 2>&-
+ montage "${thumb%.jpg}"_[0-9].jpg \
+ -background "#000000" \
+ -tile 10x1 -geometry 320x180+0+0 \
+ -interlace line -quality 85 "${thumb}"
+ rm -- "${thumb%.jpg}"_[0-9].jpg
+ fi
if LOCK "$vid_db"; then
while read -r ID NAME DESCRIPTION RESX RESY LENGTH COVER STATUS UPLOADER HITS \