public void MatroskaTestIsSrt() { string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_SRT.mkv"); using (var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName)) { bool isValid; var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid); Assert.IsTrue(tracks[0].CodecId == "S_TEXT/UTF8"); } }
public void MatroskaTestVobSubPgs() { string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv"); using (var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName)) { bool isValid; var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid); Assert.IsTrue(tracks[0].CodecId == "S_VOBSUB"); Assert.IsTrue(tracks[1].CodecId == "S_HDMV/PGS"); } }
public void MatroskaTestSrtContent() { string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_SRT.mkv"); using (var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName)) { bool isValid; var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid); var subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[0].TrackNumber), out isValid, null); Assert.IsTrue(subtitles.Count == 2); Assert.IsTrue(subtitles[0].Text == "Line 1"); Assert.IsTrue(subtitles[1].Text == "Line 2"); } }
public void MatroskaTestVobSubPgsContent() { string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv"); using (var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName)) { bool isValid; var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid); var subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[0].TrackNumber), out isValid, null); Assert.IsTrue(subtitles.Count == 2); //TODO: check bitmaps //subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[1].TrackNumber), out isValid, null); //Assert.IsTrue(subtitles.Count == 2); //check bitmaps } }