我有一个视频文件,其中包含:
Metadata:
ENCODER : Lavf58.29.100
Duration: 00:39:07.25, start: 0.000000, bitrate: 25234 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 3440x1440 [SAR 1:1 DAR 43:18], 60 fps, 60 tbr, 1k tbn, 120 tbc (default)
Metadata:
DURATION : 00:39:07.250000000
Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
title : Track1
DURATION : 00:39:07.157000000
Stream #0:2: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
title : Track2
DURATION : 00:39:07.157000000
我试图用一个命令执行两个操作:
- 将音频通道 0 和 1 合并在一起(均为立体声)
- 使用 hevc 重新编码视频
分别运行这两个命令:
ffmpeg.exe -i stuff.mkv -filter_complex "[0:a]amerge=inputs=2[a]" -ac 2 -map 0:v -map "[a]" -c:v copy other-stuff.mkv
ffmpeg.exe -hwaccel cuvid -i other-stuff.mkv -c:a copy -map 0 -c:v hevc_nvenc -preset slow -rc vbr_hq -b:v 6M -maxrate:v result.mkv
然而,我尝试合并它们却导致错误:
ffmpeg.exe -hwaccel cuvid -i stuff.mkv -filter_complex "[0:a]amerge=inputs=2[a]" -ac 2 -map 0:v -map "[a]" -c:v hevc_nvenc -preset slow -rc vbr_hq -b:v 6M -maxrate:v result.mkv
"Filter amerge has an unconnected output"
我对地图绘制工作原理的基本理解告诉我这应该没问题,但显然我遗漏了一些东西。
答案1
尝试一下并报告:
ffmpeg.exe -hwaccel cuvid -i stuff.mkv -filter_complex "[0:a:0][0:a:1]amerge=inputs=2[a]" -ac 2 -map 0:v -map "[a]" -c:v hevc_nvenc -preset slow -rc vbr_hq -b:v 6M -maxrate:v result.mkv
过滤amerge
器需要两个或更多映射输入,如上所示。