Last active
July 4, 2016 03:32
-
-
Save RhinoLu/2c7f94a020c50d0664035794aa528eab to your computer and use it in GitHub Desktop.
ffmpeg 聲音相關
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
// http://stackoverflow.com/questions/24804928/singler-line-ffmpeg-cmd-to-merge-video-audio-and-retain-both-audios | |
// 先取出影片內聲音並另存聲音檔 | |
./ffmpeg -i source1.mp4 source1_out.mp3 | |
// 將兩段聲音合併並另存聲音檔(注意音量是否被另一個聲音壓掉了) | |
./ffmpeg -i source1_out.mp3 -i source1.wav -filter_complex amerge -c:a libmp3lame -q:a 4 source1_combine.mp3 | |
// 移除原影片聲音並另存影像檔 | |
./ffmpeg -i source1.mp4 -an source1_no_sound.mp4 | |
// 最後合併影片與聲音(蓋掉原影片聲音) | |
./ffmpeg -i source1_no_sound.mp4 -i source1_combine.mp3 -strict -2 -shortest result.mp4 | |
// https://trac.ffmpeg.org/wiki/How%20to%20change%20audio%20volume%20up-down%20with%20FFmpeg | |
// 調整音量 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment