Convert video format from flv to avi
2010-12-14 12:55
453 查看
最近由于需要将一些视频由flv格式转化为avi格式,为了自动化转换,我写了如下脚本:
对于视频/音频的转换,一般都会用到ffmpeg这个工具,详情可以参考:http://www.ffmpeg.org/
#!/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/
相关文章推荐
- Convert video files from one format to another
- ffmpeg示例一:how to use libavformat and libavcodec to read video from a file.
- Convert almost all video formats to Flash, FLV, SWF
- Convert FLV to many other video formats
- Convert transcript from Youtube format to SRT format
- convert video/audio file to audio format with ffmpeg
- Convert video formats to flash FLV / SWF
- ffmpeg 音频转换: use ffmpeg convert the audio from stereo to mono without changing the video part
- CommandInvokationFailure: Unable to convert classes into dex format解决方法
- 使用Junit出现Type mismatch: cannot convert from Test to Annotation
- Cannot convert from 'const char [..]' to 'LPCTSTR'
- Error 1 error C2440: 'initializing' : cannot convert from 'wchar_t *' to 'char *'
- C++编译遇到参数错误(cannot convert parameter * from 'const char [**]' to 'LPCWSTR')
- error C2440: ’static_cast’ : cannot convert from ‘UINT (__thiscall CStaticLink::* )(CPoint)’ to ‘LRE
- cannot convert parameter * from 'const char [**]' to 'LPCWSTR'
- error C2440: 'static_cast' : cannot convert from 'void (__thiscall MenuToolBar::* )(LPARAM,LRESULT *)' to 'void (__thiscall CCmd
- “svn: Can't convert string from 'UTF-8' to native encoding” 错误
- svn: Can't convert string from 'UTF-8' to native encoding:
- Uploading audio, video or image files from Android to php server.
- 在UNICODE编码格式下使用cvSaveImage出现cannot convert from 'CString' to 'const char *