一、保留封裝格式
1. 保留原始的音頻流封裝格式
ffmpeg -i test.mp4 -acodec copy -vn audio.mp4
2. 保留原始的視頻流封裝格式
ffmpeg -i test.mp4 -vcodec copy -an video.mp4
二、提取視頻
1. 保留編碼格式
ffmpeg -i test.mp4 -vcodec copy -an test_copy.h264
2. 強制格式
ffmpeg -i test.mp4 -vcodec libx264 -an test.h264
三、提取音頻
1. 保留編碼格式
ffmpeg -i test.mp4 -acodec copy -vn test.aac
2. 強制格式
ffmpeg -i test.mp4 -acodec libmp3lame -vn test.mp3