Last active
January 4, 2022 08:43
-
-
Save peter-y/6285cc415c6c872190f9cb9459305a86 to your computer and use it in GitHub Desktop.
ffmpeg #command #tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#查看文件信息 这里的-i 其实是input 正常命令需要一个output才行 否则会产生一个错误 "At least one output file must be specified" 可忽略 或者使用 ffprobe filename 查看文件信息 | |
ffmpeg -i '.\xxx.mkv' | |
#-i 指定input 文件 -q:a 0 可变比特率 -map a 排除视频和字幕 抽出视频中的音频文件保存为mp3格式 这里原始音频可能会被转换 | |
# 这里我试了 音频的bit率 仿佛发生了变化 变得比原来的高,相比原格式的音频 大了不少 | |
ffmpeg -i '.\xxx.mkv' -q:a 0 -map a output-audio.mp3 | |
#-an 去除音频流 | |
#-vn 去除视频流 | |
#-sn 去除字幕流 | |
#-dn 去除数据流 | |
#-acodec 音频解码器 copy 复制输入的音频流 .opus是一种音频格式 输出成为什么文件 还是需要查看原始视频文件中的音频原格式是什么格式 | |
ffmpeg -i '.\xxx.mkv' -vn -acodec copy output-audio.opus | |
#m4a to wav | |
ffmpeg -i inputFilename.m4a OutputFilename.wav | |
# 音频文件 以30秒拆分音频片段 | |
ffmpeg -i testfile.wav -f segment -segment_time 30 -c copy output%09d.wav | |
# 截取指定的片段 0秒-10秒 时间格式 ‘12:03:45’‘0.2’‘200ms’=0.2s ‘23.189’ | |
ffmpeg -i testfile.wav -acodec copy -ss 0 -to 10 output10.wav | |
#合并视频和音频 | |
ffmpeg -i video.mp4 -i audio.opus -c:v copy -c:a aac -strict experimental output.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment