MatroskaRootPackage

Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.RootMetadataPackage

public class MatroskaRootPackage extends RootMetadataPackage

Represents the root package allowing working with metadata in a Matroska video.

Learn more

This example demonstrates how to extract subtitles from an MKV video.

try (Metadata metadata = new Metadata(Constants.MkvWithSubtitles)) { MatroskaRootPackage root = metadata.getRootPackageGeneric(); for (MatroskaSubtitleTrack subtitleTrack : root.getMatroskaPackage().getSubtitleTracks()) { System.out.println(subtitleTrack.getLanguageIetf() != null ? subtitleTrack.getLanguageIetf() : subtitleTrack.getLanguage()); for (MatroskaSubtitle subtitle : subtitleTrack.getSubtitles()) { System.out.println(String.format(“Timecode=%s, Duration=%s”, subtitle.getTimecode(), subtitle.getDuration())); System.out.println(subtitle.getText()); } } }

Methods

Method Description
getMatroskaPackage() Gets the Matroska metadata package.

getMatroskaPackage()

public final MatroskaPackage getMatroskaPackage()

Gets the Matroska metadata package.

Returns: MatroskaPackage - The Matroska metadata package.