我有一个带有 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 会抱怨这是一个无效参数?
答案1
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