ffmpeg常用命令
1 取视频中的音频
1 | ffmpeg -i xxx.mp4 -vn -acodec libmp3lame -ar 44100 -ac 2 -ab 192k xxx.mp4 |
2 加字幕
1 | ffmpeg -i xxx.mp4 -vf "subtitles=xxx.srt:force_style='FontName=SimSun,Bold=-1,Fontsize=8,outline=1,Shadow=0,OutlineColour=&H555555&'" -c:a copy -f mp4 xxx_out.mp4 |
3 换声音
1 | ffmpeg -i xx.mp4 -i xx.mp3 -c:v copy -map 0:v:0 -map 1:a:0 xxx.mp4 |
4 参考
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.