bashscript to convert wmv avi to flv

Feb 02 2012 Published under Linux

Following bash snippet converts wmv/avi files in a directory to flv with corresponding filename

#!/bin/bash
fileformat="wmv"; #avi

for file in $(echo *.$fileformat); 
do 
	#echo ${file%%.*}.flv; 
	if [  $fileformat = "avi" ]
	then
	  ffmpeg -i ${file} -vcodec flv ${file%%.*}.flv
  elif [ $fileformat = "wmv" ] 
  then
    ffmpeg -i ${file} -sameq -acodec libmp3lame -ar 22050 -ab 96000 -deinterlace -nr 500 -s 640x480 -aspect 4:3 -r 20 -g 500 -me_range 20 -b 270k -deinterlace -f flv -y ${file%%.*}.flv
  fi
done

No responses yet

Comments are closed at this time.

Login