» 您尚未登录:请 登录 | 注册 | 标签 | 帮助 | 小黑屋 |


发新话题
打印

[电脑] 有没有ffmpeg高手,请教一个音频转换命令

一个mkv动画片,下面有几条音轨,英语是TrueHD atmos,国语是dts,粤语是ac3,我想三条都全部转换成aac,保留可选,字幕和视频不转换,保持不动
有没有一个命令可以把3条音轨都转换成aac的?


TOP

微软copilot的回答:

Got it 👍 — you want to take an MKV file that has multiple audio tracks (possibly in different formats), convert all of them to AAC, and output a new MKV file **without touching the video or subtitle streams**.  

Here’s the correct **FFmpeg command**:

```bash
ffmpeg -i input.mkv -map 0 -c:v copy -c:s copy -c:a aac -b:a 192k output.mkv
```

### Explanation:
- `-i input.mkv` → your source MKV file.  
- `-map 0` → includes **all streams** (video, audio, subtitles).  
- `-c:v copy` → copies video as-is (no re-encoding).  
- `-c:s copy` → copies subtitle streams unchanged.  
- `-c:a aac` → converts **all audio streams** to AAC.  
- `-b:a 192k` → sets audio bitrate (you can adjust, e.g., 128k, 256k).  
- `output.mkv` → final file with AAC audio, original video, and subtitles intact.  

### Notes:
- If you want **only audio streams** (dropping video and subs entirely), use:
  ```bash
  ffmpeg -i input.mkv -map 0:a -c:a aac -b:a 192k output.mkv
  ```
  This keeps only audio tracks, all converted to AAC.  

- If your MKV has multiple audio formats (e.g., DTS, AC3, MP3), FFmpeg will transcode each one into AAC automatically.  

Do you want the **video and subtitles preserved** (just audio converted), or do you want an **audio-only MKV**?



TOP

posted by wap, platform: Firefox
这种问题ai回答不行吗?

ffmpeg -i input.mkv \
-map 0:v -c:v copy \
-map 0:a -c:a aac -b:a 192k \
-map 0:s? -c:s copy \
output.mkv


TOP

感谢两位,但是我试了,最后都只剩下音轨1,转了aac,其他两条音轨没了

TOP

posted by wap, platform: Firefox
ffmpeg -i input.mkv \
-map 0:v -c:v copy \
-map 0:a:0 -c:a:0 aac -b:a:0 192k \
-map 0:a:1 -c:a:1 aac -b:a:1 192k \
-map 0:a:2 -c:a:2 aac -b:a:2 192k \
-map 0:s? -c:s copy \
-map_metadata 0 \
output.mkv

TOP

发新话题
     
官方公众号及微博