Anyone knows how to retrieve embedded subtitle language?

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Aug 4 01:01:57 PDT 2011


On Wed, 2011-08-03 at 20:22 -0700, g-newbie wrote:

Hi,

> I need help here, on how to get the language of embedded subtitles in a MKV
> video file. So far, i can only get the subtitle type, which is S_TEXT_ASS,
> but can't find a way to get the languauge of the subtitle. 

There will be a tag event before the first buffer with a
GST_TAG_LANGUAGE tag, if the language is known.

If you're using playbin2, you can get this information via

  GstTagList *tags;

  g_signal_emit_by_name (playbin2, "get-text-tags", n, &tags);
  ... process tags ...
  gst_tag_list_free (tags);

where n is the n-th subtitle stream counting from 0.

 Cheers
  -Tim




More information about the gstreamer-devel mailing list