Recently, due to the need to convert some videos from the FLV format to the AVI format, I wrote the following script to automate the conversion:
#! /Bin/bashffcmd = '/cygdrive/C/work-DIR/FFMPEG/ffmpeg.exe' # path to ffmpe tools # Check output directory existif! Test-d $2; then mkdir $ 2FI # Convert FLV to avifor F in $ (ls $1 /*. FLV); do if test-F $ F then ECHO-e "\ nconverting $ F" FILENAME =$ (basename $ f | cut-d '. '-F 1) # echo $ filename $ ffcmd-I $ F-R 25-B 750 k-y $ filename. avi 2> log.txt MV-F $ filename. avi $2 else echo-e "\ nskipping $ F-not a regular file "; fidone # usage # You can convert the all of FLV files in FLV-Folder/to AVI file located in out-Avi-Folder/by following command # $. /convert-flv-2-avi.sh FLV-Folder/out-Avi-Folder/
For video/audio conversion, usually use FFMPEG this tool, details can refer to: http://www.ffmpeg.org/