查看原音视频文件音轨频率
ffmpeg -i "Solo Of The Week - 27 Guns N' Roses - Sweet Child O' mine.mkv"
命令执行后找到音轨的Stream,频率为48000Hz;
升降调操作
# 升半音
ffmpeg -i "Solo Of The Week - 27 Guns N' Roses - Sweet Child O' mine.mkv" -filter_complex "asetrate=48000*2^(1/12),atempo=1/2^(1/12)" "output.mkv"
# 升全音
ffmpeg -i "Solo Of The Week - 27 Guns N' Roses - Sweet Child O' mine.mkv" -filter_complex "asetrate=48000*2^(2/12),atempo=1/2^(2/12)" "output.mkv"
# 降半音
ffmpeg -i "Solo Of The Week - 27 Guns N' Roses - Sweet Child O' mine.mkv" -filter_complex "asetrate=48000*2^(-1/12),atempo=1/2^(-1/12)" "output.mkv"
# 降全音
ffmpeg -i "Solo Of The Week - 27 Guns N' Roses - Sweet Child O' mine.mkv" -filter_complex "asetrate=48000*2^(-2/12),atempo=1/2^(-2/12)" "output.mkv"
在视频中提取音频
ffmpeg -i input.mp4 -q:a 0 -map a output.mp3