我有一个包含 30 多个字幕的视频文件,我只想从中保存英文字幕轨道。
Input #0, matroska,webm, from 'Galaxy.mkv':
Metadata:
title : Galaxy.720p.WEBRip.x264-GalaxyTV
COMMENT : GalaxyTV - small excellence!
ENCODER : Lavf58.20.100
Duration: 00:47:31.48, start: 0.000000, bitrate: 880 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
title : GalaxyTV - small excellence!
ENCODER : Lavc58.35.100 libx264
DURATION : 00:47:31.453000000
Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
title : GalaxyTV - small excellence!
ENCODER : Lavc58.35.100 aac
DURATION : 00:47:31.477000000
Stream #0:2(eng): Subtitle: subrip (default)
Metadata:
title : GalaxyTV - small excellence!
ENCODER : Lavc58.35.100 srt
DURATION : 00:43:46.478000000
...
Stream #0:32(chi): Subtitle: subrip
Metadata:
title : Chinese Traditional
ENCODER : Lavc58.35.100 srt
DURATION : 00:45:40.508000000
我用ffmpeg尝试了以下内容:
ffmpeg -hide_banner -i Galaxy.mkv -c copy -map 0:v:0 -map 0:a:0 -map 0:s:m:language:eng mov_text out.mp4
但这给出了以下错误:
[NULL @ 0x7fqe85422f00] Unable to find a suitable output format for 'mov_text'
mov_text: Invalid argument
选项不应该-map 0:s:m:language:eng
选择英文字幕吗?
为什么 FFmpeg 抱怨这是一个无效的论点?
mov_text
是字幕编解码器,是编解码器选项的参数-c:s
。所以,
ffmpeg -hide_banner -i Galaxy.mkv -c copy -map 0:v:0 -map 0:a:0 -map 0:s:m:language:eng -c:s mov_text out.mp4