File: mkThumbs

package info (click to toggle)
oggvideotools 0.8a-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,732 kB
  • sloc: cpp: 10,514; ansic: 1,216; makefile: 106; sh: 27
file content (26 lines) | stat: -rwxr-xr-x 654 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
# This script creates a series of thumbnails from an Ogg/Theora file
# usage:
# ./mkThumbs file.ogv <numberOfThumbs> <optional infos for oggThumb (e.g. resizing)>
#
# typical:
# ./mkThumbs myfile.ogv 10 -s0x200
# This call creates a thumbnail series of 10 pictures with the a height of 200 pixels
#

if [ $# -lt 2 ] 
then
  echo "usage $0 <video file> <number of pictures> <size (e.g. -s0x200)>"
  exit
fi

length=`oggLength $1`
timestring="0"
div=$(($2*1000))
end=`expr $2 - 1`
for i in `seq 1 $end`
do
  value=$(echo "scale=3; $i*$length/$div" | bc -q 2>/dev/null)
  timestring="$timestring,$value"
done
oggThumb $3 $4 $5 $6 -t$timestring $1