Time is limited.

FFmpeg从视频中分离音轨

Posted on By Sifan Guo

video.mkv视频为例,保存成music.wmv的方式:先从官网下载FFmpeg,windows下载解压后进入里面有ffmpeg.exebin文件夹。然后在该目录下进入命令行,输入 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.