예제 #1
0
        public static Stream Parse(string s, LogItem _log)
        {
            //EVO, 1 video track, 1 audio track, 3 subtitle tracks, 1:43:54
            //"director"

            /////////////////////////////////////////////////////////////////
            //////// input file

            /*
             * M2TS, 1 video track, 1 audio track, 0:00:11, 60i /1.001
             * 1: h264/AVC, 1080i60 /1.001 (16:9)
             * 2: AC3, 5.1 channels, 640kbps, 48khz
             */

            if (string.IsNullOrEmpty(s))
            {
                throw new ArgumentNullException("s", "The string 's' cannot be null or empty.");
            }

            string strIdentifier = s.Split(',')[0];
            Stream stream        = null;

            if (strIdentifier.Contains("AVC") || strIdentifier.Contains("MVC") || strIdentifier.Contains("VC-1") || strIdentifier.Contains("MPEG") ||
                strIdentifier.Contains("DIRAC") || strIdentifier.Contains("THEORA") || strIdentifier.Contains("HEVC"))
            {
                stream = VideoStream.Parse(s, _log);
            }
            else if (strIdentifier.Contains("AC3") || strIdentifier.Contains("TrueHD") || strIdentifier.Contains("DTS") ||
                     strIdentifier.Contains("RAW") || strIdentifier.Contains("PCM") || strIdentifier.Contains("MP") || strIdentifier.Contains("AAC") ||
                     strIdentifier.Contains("FLAC") || strIdentifier.Contains("WAVPACK") || strIdentifier.Contains("TTA") || strIdentifier.Contains("VORBIS"))
            {
                stream = AudioStream.Parse(s, _log);
            }
            else if (strIdentifier.Contains("Subtitle"))
            {
                stream = SubtitleStream.Parse(s, _log);
            }
            else if (strIdentifier.Contains("Chapters"))
            {
                stream = ChapterStream.Parse(s, _log);
            }
            else if (strIdentifier.Contains("Joined"))
            {
                stream = JoinStream.Parse(s, _log);
            }
            else
            {
                stream = new UnknownStream(s, _log);
            }

            if ((stream is AudioStream && ((AudioStream)stream).AudioType == AudioStreamType.UNKNOWN) ||
                (stream is SubtitleStream && ((SubtitleStream)stream).SubtitleType == SubtitleStreamType.UNKNOWN) ||
                (stream is VideoStream && ((VideoStream)stream).VideoType == VideoStreamType.UNKNOWN))
            {
                stream = new UnknownStream(s, _log);
            }

            return(stream);
        }
예제 #2
0
        public static Stream Parse(string s)
        {
            //EVO, 1 video track, 1 audio track, 3 subtitle tracks, 1:43:54
            //"director"

            /////////////////////////////////////////////////////////////////
            //////// input file

            /*
             * M2TS, 1 video track, 1 audio track, 0:00:11, 60i /1.001
             * 1: h264/AVC, 1080i60 /1.001 (16:9)
             * 2: AC3, 5.1 channels, 640kbps, 48khz
             */

            if (string.IsNullOrEmpty(s))
            {
                throw new ArgumentNullException("s", "The string 's' cannot be null or empty.");
            }

            Stream stream = null;

            if (s.Contains("AVC") || s.Contains("VC-1") || s.Contains("MPEG") || s.Contains("DIRAC") || s.Contains("THEORA"))
            {
                stream = VideoStream.Parse(s);
            }
            else if (s.Contains("AC3") || s.Contains("TrueHD") || s.Contains("DTS") ||
                     s.Contains("RAW") || s.Contains("PCM") || s.Contains("MP") || s.Contains("AAC") ||
                     s.Contains("FLAC") || s.Contains("WAVPACK") || s.Contains("TTA") || s.Contains("VORBIS"))
            {
                stream = AudioStream.Parse(s);
            }
            else if (s.Contains("Subtitle"))
            {
                stream = SubtitleStream.Parse(s);
            }
            else if (s.Contains("Chapters"))
            {
                stream = ChapterStream.Parse(s);
            }
            else if (s.Contains("Joined"))
            {
                stream = JoinStream.Parse(s);
            }

            return(stream);
        }
예제 #3
0
        public static Stream Parse(string s)
        {
            //EVO, 1 video track, 1 audio track, 3 subtitle tracks, 1:43:54
            //"director"

            if (string.IsNullOrEmpty(s))
            {
                throw new ArgumentNullException("s", "The string 's' cannot be null or empty.");
            }

            Stream stream = null;

            if (s.Contains("AVC") || s.Contains("VC-1") || s.Contains("MPEG") || s.Contains("DIRAC") || s.Contains("THEORA"))
            {
                stream = VideoStream.Parse(s);
            }
            else if (s.Contains("AC3") || s.Contains("TrueHD") || s.Contains("DTS") ||
                     s.Contains("RAW") || s.Contains("PCM") || s.Contains("MP") || s.Contains("AAC") ||
                     s.Contains("FLAC") || s.Contains("WAVPACK") || s.Contains("TTA") || s.Contains("VORBIS"))
            {
                stream = AudioStream.Parse(s);
            }
            else if (s.Contains("Subtitle"))
            {
                stream = SubtitleStream.Parse(s);
            }
            else if (s.Contains("Chapters"))
            {
                stream = ChapterStream.Parse(s);
            }
            else if (s.Contains("Joined"))
            {
                stream = JoinStream.Parse(s);
            }

            return(stream);
        }