如何使用 GStreamer 从 .mkv 文件中提取字幕?

How to extract subtitles from a .mkv file using GStreamer?

如果gst-discover-1.0验证了.mkv有字幕,那么gst-launch-1.0如何提取字幕?谢谢

什么样的字幕?您必须从 gst-discoverer-1.0 获取上限,然后执行类似

的操作
gst-launch-1.0 filesrc location=/path/to/mkv ! matroskademux ! "text/x-raw" ! filesink location=subtitles

其中 "text/x-raw" 替换为字幕流的大写字母。或者你也可以指定 link by pad name

gst-launch-1.0 filesrc location=/path/to/mkv ! matroskademux name=demux   demux.subtitle_%u ! filesink location=subtitles

其中 %u 应该是字幕流的曲目号。