MatroskaRootPackage
Leave feedback
On this page
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()); } } }
| Method | Description |
|---|---|
| getMatroskaPackage() | Gets the Matroska metadata package. |
public final MatroskaPackage getMatroskaPackage()
Gets the Matroska metadata package.
Returns: MatroskaPackage - The Matroska metadata package.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.