コード例 #1
0
        public static void setVideoOptions(Dictionary<String, Object> options, VideoEncoderPresets preset, VideoEncoders encoder)
        {
            
            switch (encoder)
            {

                case VideoEncoders.none:
                    break;
                case VideoEncoders.libx264:
                    options.Add("preset", preset.ToString().ToLower());
                    break;
                case VideoEncoders.libx265:
                    options.Add("preset", preset.ToString().ToLower());
                    break;
                case VideoEncoders.libvpx:
                    options.Add("b", 1000000);
                    options.Add("crf", "5");
                    options.Add("qmin", "0");
                    options.Add("qmax", "50");
                    options.Add("threads", "3");
                    options.Add("slices", "2");
                    break;
                case VideoEncoders.libvpx_vp9:
                    options.Add("b", 1000000);
                    options.Add("threads", "8");
                    options.Add("speed", "1");
                    options.Add("tile-columns", "6");
                    options.Add("frame-parallel", "1");
                    options.Add("auto-alt-ref", "1");
                    options.Add("lag-in-frames", "25");
                    break;
                case VideoEncoders.msmpeg4:
                    options.Add("b", 2000000);
                    break;
                case VideoEncoders.wmv1:
                    options.Add("b", 2000000);
                    break;
                case VideoEncoders.wmv2:
                    options.Add("b", 2000000);
                    break;
                case VideoEncoders.gif:
                    break;
                case VideoEncoders.apng:
                    break;
                default:
                    break;
            }

        }
コード例 #2
0
        public AdvancedSettingsViewModel(AdvancedSettingsModel model, TrackableViewModel parent) : base(parent)
        {
            _model         = model;
            videoVeiwModel = ((StreamViewModel)parent).VideoViewModel;

            var encoders = EncoderHelper.GetVideoEncoders();

            VideoEncoders.AddRange(encoders);

            var encoder = encoders.FirstOrDefault(e => e.Id == _model.EncoderId) ?? encoders.FirstOrDefault();

            this.VideoEncoder = encoder;

            AdjustResolutionCommand = new DelegateCommand(AdjustVideoResolution);
        }
コード例 #3
0
 /// <summary>
 /// Gets the video encoder with the specified short name.
 /// </summary>
 /// <param name="shortName">
 /// The name of the video encoder.
 /// </param>
 /// <returns>
 /// The requested video encoder.
 /// </returns>
 public static HBVideoEncoder GetVideoEncoder(string shortName)
 {
     return(VideoEncoders.SingleOrDefault(e => e.ShortName == shortName));
 }
コード例 #4
0
        public static void setVideoOptions(Dictionary <String, Object> options, VideoEncoderPresets preset, VideoEncoders encoder)
        {
            switch (encoder)
            {
            case VideoEncoders.none:
                break;

            case VideoEncoders.libx264:
                options.Add("preset", preset.ToString().ToLower());
                break;

            case VideoEncoders.libx265:
                options.Add("preset", preset.ToString().ToLower());
                break;

            case VideoEncoders.libvpx:
                options.Add("b", 1000000);
                options.Add("crf", "5");
                options.Add("qmin", "0");
                options.Add("qmax", "50");
                options.Add("threads", "3");
                options.Add("slices", "2");
                break;

            case VideoEncoders.libvpx_vp9:
                options.Add("b", 1000000);
                options.Add("threads", "8");
                options.Add("speed", "1");
                options.Add("tile-columns", "6");
                options.Add("frame-parallel", "1");
                options.Add("auto-alt-ref", "1");
                options.Add("lag-in-frames", "25");
                break;

            case VideoEncoders.msmpeg4:
                options.Add("b", 2000000);
                break;

            case VideoEncoders.wmv1:
                options.Add("b", 2000000);
                break;

            case VideoEncoders.wmv2:
                options.Add("b", 2000000);
                break;

            case VideoEncoders.gif:
                break;

            case VideoEncoders.apng:
                break;

            default:
                break;
            }
        }
コード例 #5
0
        bool supportedVideoEncodersFilter(object videoEncoder)
        {
            VideoEncoders encoder = (VideoEncoders)videoEncoder;

            switch (ContainerFormat)
            {
            case ContainerFormats.MP4:
                if (encoder == VideoEncoders.libx264 ||
                    encoder == VideoEncoders.libx265)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.MOV:
                if (encoder == VideoEncoders.libx264)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.AVI:
                if (encoder == VideoEncoders.libx264)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.MKV:
                if (encoder == VideoEncoders.libx264 ||
                    encoder == VideoEncoders.libx265 ||
                    encoder == VideoEncoders.libvpx ||
                    encoder == VideoEncoders.libvpx_vp9)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.FLV:
                if (encoder == VideoEncoders.libx264)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.WMV:
                if (encoder == VideoEncoders.msmpeg4 ||
                    encoder == VideoEncoders.wmv1 ||
                    encoder == VideoEncoders.wmv2)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.WEBM:
                if (encoder == VideoEncoders.libvpx ||
                    encoder == VideoEncoders.libvpx_vp9)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.GIF:
                if (encoder == VideoEncoders.gif)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.PNG:
                if (encoder == VideoEncoders.apng)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.MP3:
                if (encoder == VideoEncoders.none)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.M4A:
                if (encoder == VideoEncoders.none)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.OGG:
                if (encoder == VideoEncoders.none)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            case ContainerFormats.FLAC:
                if (encoder == VideoEncoders.none)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }

            default:
                return(false);
            }
        }