Exemplo n.º 1
0
        public BitRate ComputeNewBitRate(Size size)
        {
            BitRate newBitRate = new BitRate();

            newBitRate.Video = (int)Math.Ceiling((size.Width * size.Height * Settings.Default.bitRateLinear + Settings.Default.bitRateOffset) / 100) * 100;

            if (size.Height >= 1080 || size.Width >= 1920)
            {
                newBitRate.Audio = 256;
            }
            else
            {
                newBitRate.Audio = 196;
            }

            if (BitRate.Video != 0 && newBitRate.Video > BitRate.Video)
                newBitRate.Video = BitRate.Video;

            if (BitRate.Audio != 0 && newBitRate.Audio > BitRate.Audio)
                newBitRate.Audio = BitRate.Audio;

            return newBitRate;
        }
Exemplo n.º 2
0
        protected override void formatParams(BitRate bitRate, int pass = 0)
        {
            parameters.Add("f", "webm");

            parameters.Add("vcodec", "libvpx");
            parameters.Add("b", string.Format("{0}k", bitRate.Video));

            if (pass == 1)
            {
                parameters.Add("an");
            }
            else
            {
                parameters.Add("acodec", "libvorbis");
                parameters.Add("ab", string.Format("{0}k", bitRate.Audio));
            }
        }
Exemplo n.º 3
0
 protected abstract void formatParams(BitRate bitRate, int pass = 0);
Exemplo n.º 4
0
        protected override void formatParams(BitRate bitRate, int pass = 0)
        {
            parameters.Add("f", "mp4");

            parameters.Add("vcodec", "libx264");
            parameters.Add("b", string.Format("{0}k", bitRate.Video));

            if (pass == 1)
            {
                parameters.Add("an");
                parameters.Add("vpre", "slow_firstpass");
            }
            else
            {
                parameters.Add("acodec", "aac");
                parameters.Add("strict", "experimental"); // Because AAC codec is still experimental
                parameters.Add("ab", string.Format("{0}k", bitRate.Audio));
                parameters.Add("vpre", "slow");
            }
        }