Updated for Ubuntu 22.04. Also fixed merge videos cmin check
[videoscripts/.git] / avi2flv
1 #!/bin/bash
2
3 if [[ -z "$1" ]];
4 then
5   echo "Usage: $0 <filename>"
6   exit 1
7 fi
8
9 echo "-> Encoding $1 to flash video format..."
10
11 if [[ ! -f "$1" ]];
12 then
13   echo "-E- Unable to find file to encode: $1"
14   exit 1
15 fi
16
17 # set output filename
18 output=`echo $1 | sed -e 's/\..*$/\.flv/'`
19
20 # first pass
21 ffmpeg -y -i $1 -s 320x240 -pass 1 -acodec copy $output
22
23 # second pass
24 ffmpeg -y -i $1 -s 320x240 -pass 2 -acodec copy $output
25