Exemple #1
0
        private void ComboFormatOnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            VideoContainer currentContainer = (VideoContainer)comboFormat.SelectedItem;

            comboCodec.Items.Clear();
            foreach (Codec codec in currentContainer.SupportedCodecs)
            {
                comboCodec.Items.Add(codec);
                if (Settings.Default.VideoCodec == codec.Name)
                {
                    comboCodec.SelectedItem = Settings.Default.VideoCodec;
                }
            }

            if (comboCodec.SelectedItem == null)
            {
                comboCodec.SelectedIndex = 0;
            }
        }
Exemple #2
0
        private void Page_Initialized(object sender, EventArgs e)
        {
            List <string> fonts = new List <string>();

            foreach (var fontFamily in fontManager.FontFamilies)
            {
                fonts.Add(fontFamily);
            }
            fonts.Sort();
            foreach (var font in fonts)
            {
                comboFont.Items.Add(font);
            }
            if (comboFont.Items.Contains("Arial"))
            {
                comboFont.SelectedItem = "Arial";
            }

            Codec h264Codec = new Codec()
            {
                Name = "H264", InputArgs = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt bgra -video_size {width}x{height} -i -", OutputArgs = "-c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p \"{save_path}\""
            };
            Codec h265Codec = new Codec()
            {
                Name = "H265", InputArgs = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt bgra -video_size {width}x{height} -i -", OutputArgs = "-c:v libx265 -preset veryfast -crf 18 -pix_fmt yuv420p \"{save_path}\""
            };
            Codec vp8Codec = new Codec()
            {
                Name = "VP8", InputArgs = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt bgra -video_size {width}x{height} -i -", OutputArgs = "-c:v libvpx -crf 18 -b:v 2M -pix_fmt yuva420p -auto-alt-ref 0 \"{save_path}\""
            };
            Codec vp9Codec = new Codec()
            {
                Name = "VP9", InputArgs = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt bgra -video_size {width}x{height} -i -", OutputArgs = "-c:v libvpx-vp9 -crf 18 -b:v 2M -pix_fmt yuva420p \"{save_path}\""
            };
            Codec rleCodec = new Codec()
            {
                Name = "RLE", InputArgs = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt bgra -video_size {width}x{height} -i -", OutputArgs = "-c:v qtrle -pix_fmt argb \"{save_path}\""
            };
            Codec proresCodec = new Codec()
            {
                Name = "ProRes", InputArgs = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt bgra -video_size {width}x{height} -i -", OutputArgs = "-c:v prores_ks -qscale:v 62 -pix_fmt argb \"{save_path}\""
            };
            VideoContainer mp4Container = new VideoContainer()
            {
                Name = "MP4", SupportedCodecs = new List <Codec>()
                {
                    h264Codec, h265Codec
                }
            };
            VideoContainer movContainer = new VideoContainer()
            {
                Name = "MOV", SupportedCodecs = new List <Codec>()
                {
                    h264Codec, h265Codec, rleCodec, proresCodec
                }
            };
            VideoContainer webmContainer = new VideoContainer()
            {
                Name = "WEBM", SupportedCodecs = new List <Codec>()
                {
                    vp8Codec, vp9Codec
                }
            };
            VideoContainer mkvContainer = new VideoContainer()
            {
                Name = "MKV", SupportedCodecs = new List <Codec>()
                {
                    h264Codec, h265Codec, vp8Codec, vp9Codec
                }
            };

            comboFormat.Items.Add(mp4Container);
            comboFormat.Items.Add(movContainer);
            comboFormat.Items.Add(webmContainer);
            comboFormat.Items.Add(mkvContainer);

            LoadSettings();
        }