最近由于需要将一些视频由flv格式转化为avi格式,为了自动化转换,我写了如下脚本:

#!/bin/bash FFCMD='/cygdrive/c/work-dir/ffmpeg/ffmpeg.exe' # path to ffmpe tools #check output directory exist if ! test -d $2; then mkdir $2 fi #convert flv to avi for 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 750k -y $FILENAME.avi 2>> log.txt mv -f $FILENAME.avi $2 else echo -e "\nSkipping $f - not a regular file"; fi done #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/

 

对于视频/音频的转换,一般都会用到ffmpeg这个工具,详情可以参考:http://www.ffmpeg.org/

相关文章:

  • 2022-12-23
  • 2021-09-27
  • 2021-04-02
  • 2021-05-10
  • 2021-08-31
  • 2021-07-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-06-20
  • 2021-05-31
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案