Esempio n. 1
0
        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");
            }
        }
Esempio n. 2
0
        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
            }
        }