以video.mkv
视频为例,保存成music.wmv
的方式:先从官网下载FFmpeg,windows下载解压后进入里面有ffmpeg.exe
的bin
文件夹。然后在该目录下进入命令行,输入
ffmpeg.exe -i video.wmv -ab 256k -ac 2 -ar 44100 -vn -ss 24.0 -t 00:05:36 music.wav
具体参数根据不同的视频可以ffmpeg.exe -h
查看调整,这里用的-ss
标记了开始时间从第24秒开始,然后-t
标记了持续时长,而非结束时间。
reference: https://superuser.com/questions/138331/using-ffmpeg-to-cut-up-video
You can use the -ss option to specify a start timestamp, and the -t option to specify the encoding duration. The timestamps need to be in HH:MM:SS.xxx format or in seconds (s.msec).
The following would clip the first 30 seconds, and then clip everything that is 10 seconds after that:
ffmpeg -ss 00:00:30.0 -i input.wmv -c copy -t 00:00:10.0 output.wmv
ffmpeg -ss 30 -i input.wmv -c copy -t 10 output.wmv
Note that -t is an output option and always needs to be specified after -i.