Esempio n. 1
0
        public void Video_ToMP4_Args()
        {
            var container = new ArgumentsContainer();

            container.Add(new VideoCodecArgument(VideoCodec.LibX264));
            Convert(VideoType.Mp4, container);
        }
Esempio n. 2
0
        public void Video_ToOGV_Resize_Args()
        {
            var container = new ArgumentsContainer();

            container.Add(new ScaleArgument(VideoSize.Ed));
            container.Add(new VideoCodecArgument(VideoCodec.LibTheora));
            Convert(VideoType.Ogv, container);
        }
Esempio n. 3
0
        public override void Apply(ArgumentsContainer arguments)
        {
            if (arguments.Arguments.Count != 2)
            {
                throw new ArgumentException( );
            }

            Performer.Move(( MoveType )arguments.Arguments [0], ( DiceType )arguments.Arguments [1]);
        }
Esempio n. 4
0
        public void Video_ToTS_Args()
        {
            var container = new ArgumentsContainer();

            container.Add(new CopyArgument());
            container.Add(new BitStreamFilterArgument(Channel.Video, Filter.H264_Mp4ToAnnexB));
            container.Add(new ForceFormatArgument(VideoCodec.MpegTs));
            Convert(VideoType.Ts, container);
        }
Esempio n. 5
0
        public VideoInfo Convert(ArgumentsContainer arguments, FileInfo input, FileInfo output)
        {
            var args = argumentBuilder.BuildArguments(arguments, input, output);

            if (!RunProcess(args, output))
            {
                throw new FFMpegException(FFMpegExceptionType.Operation, "Could not replace the video audio.");
            }

            return(new VideoInfo(output));
        }
Esempio n. 6
0
        public void Builder_BuildString_Concat()
        {
            var container = new ArgumentsContainer();

            container.Add(new OutputArgument("output.mp4"));

            container.Add(new ConcatArgument(concatFiles));

            var str = builder.BuildArguments(container);

            Assert.IsTrue(str == "-i \"concat:1.mp4|2.mp4|3.mp4|4.mp4\" \"output.mp4\"");
        }
Esempio n. 7
0
        public VideoInfo Convert(ArgumentsContainer arguments)
        {
            var args   = argumentBuilder.BuildArguments(arguments);
            var output = ((OutputArgument)arguments[typeof(OutputArgument)]).GetAsFileInfo();

            if (!RunProcess(args, output))
            {
                throw new FFMpegException(FFMpegExceptionType.Operation, "Could not replace the video audio.");
            }

            return(new VideoInfo(output));
        }
Esempio n. 8
0
        private string GetArgumentsString(params Argument[] args)
        {
            var container = new ArgumentsContainer();

            container.Add(new OutputArgument("output.mp4"));
            container.Add(new InputArgument("input.mp4"));

            foreach (var a in args)
            {
                container.Add(a);
            }

            return(builder.BuildArguments(container));
        }
Esempio n. 9
0
        public void Convert(VideoType type, ArgumentsContainer container)
        {
            var output = Input.OutputLocation(type);

            try
            {
                var input = VideoInfo.FromFileInfo(Input);

                container.Add(new InputArgument(input));
                container.Add(new OutputArgument(output));
                var scaling = container.Find <ScaleArgument>();

                Encoder.Convert(container);

                var outputVideo = new VideoInfo(output.FullName);

                Assert.IsTrue(File.Exists(output.FullName));
                Assert.AreEqual(outputVideo.Duration, input.Duration);

                if (scaling == null)
                {
                    Assert.AreEqual(outputVideo.Width, input.Width);
                    Assert.AreEqual(outputVideo.Height, input.Height);
                }
                else
                {
                    if (scaling.Value.Width != -1)
                    {
                        Assert.AreEqual(outputVideo.Width, scaling.Value.Width);
                    }

                    if (scaling.Value.Height != -1)
                    {
                        Assert.AreEqual(outputVideo.Height, scaling.Value.Height);
                    }

                    Assert.AreNotEqual(outputVideo.Width, input.Width);
                    Assert.AreNotEqual(outputVideo.Height, input.Height);
                }
            }
            finally
            {
                if (File.Exists(output.FullName))
                {
                    File.Delete(output.FullName);
                }
            }
        }
Esempio n. 10
0
 public abstract void Use(ArgumentsContainer arguments);
Esempio n. 11
0
 public override void Apply(ArgumentsContainer arguments)
 {
     Game.Current.AuctionPerformer.PerformAuction(new AuctionRequest(0, null, null));
 }
Esempio n. 12
0
 public override void Apply(ArgumentsContainer arguments)
 {
     Card.Use(arguments);
 }
Esempio n. 13
0
 public void ApplyPlayerCommand(PlayerCommand command, ArgumentsContainer arguments)
 {
 }
Esempio n. 14
0
 /// <summary>
 ///     执行这个指令
 /// </summary>
 public abstract void Apply(ArgumentsContainer arguments);
Esempio n. 15
0
        public override void Use(ArgumentsContainer arguments)
        {
            ArgumentsInfo.CheckArgument(arguments);

//todo
        }
Esempio n. 16
0
		public override void Use ( ArgumentsContainer arguments )
		{
			ArgumentsInfo . CheckArgument ( arguments ) ;
			BlackBuff buff = new BlackBuff ( ( Stock ) arguments . Arguments . Single ( ) , Duration ) ;
		}
Esempio n. 17
0
 public override void Use(ArgumentsContainer arguments)
 {
     throw new NotImplementedException( );
 }