Exemplo n.º 1
0
        /// <summary>
        /// sets the GUI to a minimal mode allowing to configure audio track languages, configure subtitles, and chapters
        /// the rest of the options are deactivated
        /// </summary>
        /// <param name="videoInput">the video input</param>
        /// <param name="framerate">the framerate of the video input</param>
        /// <param name="audioStreams">the audio streams whose languages have to be assigned</param>
        /// <param name="output">the output file</param>
        /// <param name="splitSize">the output split size</param>
        public void setMinimizedMode(string videoInput, string videoName, VideoEncoderType videoType, double framerate, MuxStream[] audioStreams, AudioEncoderType[] audioTypes, string output,
                                     FileSize?splitSize, ContainerType cft)
        {
            base.setConfig(videoInput, videoName, (decimal)framerate, audioStreams, new MuxStream[0], new ChapterInfo(), output, splitSize, null, null);

            minimizedMode   = true;
            knownVideoType  = videoType;
            knownAudioTypes = audioTypes;

            // disable controls where required
            videoGroupbox.Enabled = false;

            for (int i = 0; i < audioStreams.Length; ++i)
            {
                audioTracks[i].SetAutoEncodeMode();
            }

            this.output.Filename = output;
            this.splitting.Value = splitSize;
            this.muxButton.Text  = "Go";
            updatePossibleContainers();
            if (this.cbContainer.Items.Contains(cft))
            {
                cbContainer.SelectedItem = cft;
            }
            checkIO();
        }
Exemplo n.º 2
0
        private void videoProfile_SelectedProfileChanged(object sender, EventArgs e)
        {
            updateIOConfig();

            if (CurrentSettings.EncoderType == lastCodec)
            {
                return;
            }

            lastCodec = CurrentSettings.EncoderType;

            VideoType[] vArray = videoEncoderProvider.GetSupportedOutput(lastCodec);
            if (lastCodec == VideoEncoderType.XVID)
            {
                Array.Resize(ref vArray, vArray.Length + 2);
                vArray[vArray.Length - 2] = VideoType.AVI;
                vArray[vArray.Length - 1] = VideoType.MKV;
            }
            else if (lastCodec == VideoEncoderType.X264)
            {
                Array.Resize(ref vArray, vArray.Length + 1);
                vArray[vArray.Length - 1] = VideoType.MP4;
            }
            else if (lastCodec == VideoEncoderType.X265)
            {
                Array.Resize(ref vArray, vArray.Length + 2);
                vArray[vArray.Length - 2] = VideoType.MKV;
                vArray[vArray.Length - 1] = VideoType.MP4;
            }

            Util.ChangeItemsKeepingSelectedSame(fileType, vArray);
        }
Exemplo n.º 3
0
 public VideoCodecSettings(string id, VideoEncoderType vet)
 {
     this.id              = id;
     this.vet             = vet;
     logfile              = ".stats";
     customEncoderOptions = "";
     videoName            = "";
     nbThreads            = 1;
 }
Exemplo n.º 4
0
 public VideoCodecSettings(string id, VideoEncoderType vet)
 {
     this.id = id;
     this.vet = vet;
     logfile = ".stats";
     customEncoderOptions = "";
     videoName = "";
     fourCC = 0;
     nbThreads = 1;
 }
Exemplo n.º 5
0
        private void videoProfile_SelectedProfileChanged(object sender, EventArgs e)
        {
            if (CurrentSettings.EncoderType == lastCodec)
            {
                return;
            }

            lastCodec = CurrentSettings.EncoderType;
            Util.ChangeItemsKeepingSelectedSame(fileType, videoEncoderProvider.GetSupportedOutput(lastCodec));
        }
Exemplo n.º 6
0
        public bool CanBeMuxed(VideoEncoderType codec, AudioEncoderType[] audioCodecs, ContainerType containerType,
                               params MuxableType[] decidedTypes)
        {
            MuxPath muxPath = GetMuxPath(codec, audioCodecs, containerType, decidedTypes);

            if (muxPath != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 7
0
        public List <ContainerType> GetSupportedContainers(VideoEncoderType videoCodec, AudioEncoderType[] audioCodecs,
                                                           params MuxableType[] dictatedOutputTypes)
        {
            List <ContainerType> supportedContainers = new List <ContainerType>();
            List <ContainerType> allKnownContainers  = GetSupportedContainers();

            foreach (ContainerType cot in allKnownContainers)
            {
                if (CanBeMuxed(videoCodec, audioCodecs, cot, dictatedOutputTypes))
                {
                    if (!supportedContainers.Contains(cot))
                    {
                        supportedContainers.Add(cot);
                    }
                }
            }
            return(supportedContainers);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Finds the best mux path and the output types the encoders should produce
        /// </summary>
        /// <param name="videoCodec"></param>
        /// <param name="audioCodecs"></param>
        /// <param name="containerType"></param>
        /// <param name="dictatedTypes"></param>
        /// <returns></returns>
        public MuxPath GetMuxPath(VideoEncoderType videoCodec, AudioEncoderType[] audioCodecs, ContainerType containerType,
                                  params MuxableType[] dictatedTypes)
        {
            List <IEncoderType> inputCodecs = new List <IEncoderType>();

            if (videoCodec != null)
            {
                inputCodecs.Add(videoCodec);
            }
            foreach (AudioEncoderType ac in audioCodecs)
            {
                inputCodecs.Add(ac);
            }

            List <MuxableType> decidedTypeList = new List <MuxableType>();

            foreach (MuxableType st in dictatedTypes)
            {
                decidedTypeList.Add(st);
            }
            return(findBestMuxPathAndConfig(inputCodecs, decidedTypeList, containerType));
        }
Exemplo n.º 9
0
        /// <summary>
        /// sets the GUI to a minimal mode allowing to configure audio track languages, configure subtitles, and chapters
        /// the rest of the options are deactivated
        /// </summary>
        /// <param name="videoInput">the video input</param>
        /// <param name="framerate">the framerate of the video input</param>
        /// <param name="audioStreams">the audio streams whose languages have to be assigned</param>
        /// <param name="output">the output file</param>
        /// <param name="splitSize">the output split size</param>
        public void setMinimizedMode(string videoInput, VideoEncoderType videoType, double framerate, MuxStream[] audioStreams, AudioEncoderType[] audioTypes, string output,
            FileSize? splitSize, ContainerType cft)
        {
            base.setConfig(videoInput, (decimal)framerate, audioStreams, new MuxStream[0], null, output, splitSize, null, null);

            minimizedMode = true;
            knownVideoType = videoType;
            knownAudioTypes = audioTypes;

            // disable everything
            videoGroupbox.Enabled = false;

            for (int i = 0; i < audioStreams.Length; ++i)
                audioTracks[i].Enabled = false;

            this.output.Filename = output;
            this.splitting.Value = splitSize;
            this.muxButton.Text = "Go";
            updatePossibleContainers();
            if (this.cbContainer.Items.Contains(cft))
                cbContainer.SelectedItem = cft;
            checkIO();
        }
Exemplo n.º 10
0
        private void videoProfile_SelectedProfileChanged(object sender, EventArgs e)
        {
            if (CurrentSettings.EncoderType == lastCodec)
                return;

            lastCodec = CurrentSettings.EncoderType;
            Util.ChangeItemsKeepingSelectedSame(fileType, videoEncoderProvider.GetSupportedOutput(lastCodec));
        }