Ejemplo n.º 1
0
        private static List <LineInfo> ParseSubtitleInVideoFile(Settings settings, string filename, Dictionary <String, String> properties)
        {
            StreamInfo subtitleStreamInfo = UtilsVideo.ChooseStreamInfo(filename, properties, StreamInfo.StreamType.ST_SUBTITLE);

            // new subtitle file
            String videoFileHash       = UtilsCommon.GetDateSizeChecksum(filename);
            String newSubtitleFileName = videoFileHash + "_" + subtitleStreamInfo.StreamIndex + GetExtensionByStreamInfo(subtitleStreamInfo);
            string newSubtitleFilePath = InstanceSettings.temporaryFilesPath + newSubtitleFileName;

            // do not extract again when file was already extracted once
            if (!File.Exists(newSubtitleFilePath))
            {
                UtilsVideo.ExtractStream(filename, subtitleStreamInfo, newSubtitleFilePath);
            }

            return(ParseSubtitle(settings, newSubtitleFilePath, properties));
        }