Example #1
0
        public void CheckCorrectAudioValueListTest()
        {
            //Arrange
            MetadataServiceConfigurator serviceConfigurator = Factory.CreateMp4MetadataServiceConfigurator();

            var metadata = new VideoMediaInfo
            {
                AudioBitRate       = serviceConfigurator.AudioBps720P1Channel,
                AudioChannels      = (int)AudioChannel.One,
                AudioFormat        = "AAC",
                AudioFormatProfile = "LC",
                VideoWidth         = 4096,
                VideoHeight        = 2304
            };

            var metadataService = new MetadataService(serviceConfigurator, metadata);

            //Act
            metadataService.AdjustAudioBps();
            metadataService.AdjustAudioCodec();
            metadataService.AdjustAudioProfile();

            //Assert
            Assert.IsTrue(metadataService.CorrectAudioValueList.All((b) => b.Value));
        }
        public void CheckCorrectAudioValueListTest()
        {
            //Arrange
            var serviceConfigurator = Factory.CreateMp4MetadataServiceConfigurator();

            var metadata = new VideoMetadata()
            {
                AudioBps      = serviceConfigurator.AudioBps720P1Channel,
                AudioChannel  = AudioChannel.One,
                AudioCodec    = "AAC",
                AudioProfile  = "LC",
                VideoBps      = serviceConfigurator.VideoBps1920X1080,
                VideoCodec    = "AVC",
                VideoProfile  = "Baseline",
                VideoFps      = serviceConfigurator.MaxFps - 1,
                VideoKeyFrame = serviceConfigurator.KeyFrame,
                Width         = 4096,
                Height        = 2304
            };

            var metadataService = new MetadataService(serviceConfigurator, metadata);

            //Act
            metadataService.AdjustAudioBps();
            metadataService.AdjustAudioCodec();
            metadataService.AdjustAudioProfile();

            //Assert
            Assert.IsTrue(metadataService.CorrectAudioValueList.All((b) => b.Value));
        }
Example #3
0
        public void AdjustAudioBpsForVideoSizeLessConfigureMaxSizeTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata128Bps = new VideoMediaInfo
            {
                VideoWidth    = 1920,
                VideoHeight   = 1080,
                AudioChannels = (int)AudioChannel.One,
                AudioBitRate  = metadataConfigurator.AudioBps720P1Channel
            };

            var metadataService1 = new MetadataService(metadataConfigurator, metadata128Bps);

            //Act
            int adjBps = metadataService1.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps720P1Channel, adjBps);
        }
        public void AdjustAudioBpsFor854X480And640X360AndLessX6ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata64Bps = new VideoMetadata()
            {
                Width        = 640,
                Height       = 360,
                AudioChannel = AudioChannel.Six,
                AudioBps     = metadataConfigurator.AudioBps360P6Channel
            };
            var metadataMore64Bps = new VideoMetadata()
            {
                Width        = 640,
                Height       = 360,
                AudioChannel = AudioChannel.Six,
                AudioBps     = metadataConfigurator.AudioBps360P6Channel + 1
            };
            var metadataLess64Bps = new VideoMetadata()
            {
                Width        = 640,
                Height       = 360,
                AudioChannel = AudioChannel.Six,
                AudioBps     = metadataConfigurator.AudioBps360P6Channel - 1
            };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata64Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore64Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess64Bps);

            //Act
            var adjBps64Bps     = metadataService1.AdjustAudioBps();
            var adjBpsMore64Bps = metadataService2.AdjustAudioBps();
            var adjBpsLess64Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps360P6Channel, adjBps64Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps360P6Channel, adjBpsMore64Bps);
            Assert.AreEqual(metadataLess64Bps.AudioBps, adjBpsLess64Bps);
        }
        public void AdjustAudioBpsFor1920X1080And1280X720X6ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata512Bps = new VideoMetadata()
            {
                Width        = 1280,
                Height       = 720,
                AudioChannel = AudioChannel.Six,
                AudioBps     = metadataConfigurator.AudioBps720P6Channel
            };
            var metadataMore512Bps = new VideoMetadata()
            {
                Width        = 1280,
                Height       = 720,
                AudioChannel = AudioChannel.Six,
                AudioBps     = metadataConfigurator.AudioBps720P6Channel + 1
            };
            var metadataLess512Bps = new VideoMetadata()
            {
                Width        = 1280,
                Height       = 720,
                AudioChannel = AudioChannel.Six,
                AudioBps     = metadataConfigurator.AudioBps720P6Channel - 1
            };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata512Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore512Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess512Bps);

            //Act
            var adjBps512Bps     = metadataService1.AdjustAudioBps();
            var adjBpsMore512Bps = metadataService2.AdjustAudioBps();
            var adjBpsLess512Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps720P6Channel, adjBps512Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps720P6Channel, adjBpsMore512Bps);
            Assert.AreEqual(metadataLess512Bps.AudioBps, adjBpsLess512Bps);
        }
Example #6
0
        public void AdjustAudioBpsFor854X480And640X360AndLessX2ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata64Bps = new VideoMediaInfo
            {
                VideoWidth    = 640,
                VideoHeight   = 360,
                AudioChannels = (int)AudioChannel.Two,
                AudioBitRate  = metadataConfigurator.AudioBps360P2Channel
            };
            var metadataMore64Bps = new VideoMediaInfo
            {
                VideoWidth    = 640,
                VideoHeight   = 360,
                AudioChannels = (int)AudioChannel.Two,
                AudioBitRate  = metadataConfigurator.AudioBps360P2Channel + 1
            };
            var metadataLess64Bps = new VideoMediaInfo
            {
                VideoWidth    = 640,
                VideoHeight   = 360,
                AudioChannels = (int)AudioChannel.Two,
                AudioBitRate  = metadataConfigurator.AudioBps360P2Channel - 1
            };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata64Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore64Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess64Bps);

            //Act
            int adjBps64Bps     = metadataService1.AdjustAudioBps();
            int adjBpsMore64Bps = metadataService2.AdjustAudioBps();
            int adjBpsLess64Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps360P2Channel, adjBps64Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps360P2Channel, adjBpsMore64Bps);
            Assert.AreEqual(metadataLess64Bps.AudioBitRate, adjBpsLess64Bps);
        }
Example #7
0
        public void AdjustAudioBpsFor1920X1080And1280X720X2ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata384Bps = new VideoMediaInfo
            {
                VideoWidth    = 1280,
                VideoHeight   = 720,
                AudioChannels = (int)AudioChannel.Two,
                AudioBitRate  = metadataConfigurator.AudioBps720P2Channel
            };
            var metadataMore384Bps = new VideoMediaInfo
            {
                VideoWidth    = 1280,
                VideoHeight   = 720,
                AudioChannels = (int)AudioChannel.Two,
                AudioBitRate  = metadataConfigurator.AudioBps720P2Channel + 1
            };
            var metadataLess384Bps = new VideoMediaInfo
            {
                VideoWidth    = 1280,
                VideoHeight   = 720,
                AudioChannels = (int)AudioChannel.Two,
                AudioBitRate  = metadataConfigurator.AudioBps720P2Channel - 1
            };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata384Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore384Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess384Bps);

            //Act
            int adjBps384Bps     = metadataService1.AdjustAudioBps();
            int adjBpsMore384Bps = metadataService2.AdjustAudioBps();
            int adjBpsLess384Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps720P2Channel, adjBps384Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps720P2Channel, adjBpsMore384Bps);
            Assert.AreEqual(metadataLess384Bps.AudioBitRate, adjBpsLess384Bps);
        }
        public void AdjustAudioBpsForVideoSizeMoreConfigureMaxSizeTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);
            metadataConfigurator.MaxWidth = 854;
            metadataConfigurator.MaxHeight = 480;

            var metadata128Bps = new VideoMediaInfo
                {
                    VideoWidth = 1920,
                    VideoHeight = 1080,
                    AudioChannels = (int) AudioChannel.One,
                    AudioBitRate = metadataConfigurator.AudioBps720P1Channel
                };

            var metadataService1 = new MetadataService(metadataConfigurator, metadata128Bps);

            //Act
            int adjBps = metadataService1.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps360P1Channel, adjBps);
        }
        public void CheckCorrectAudioValueListTest()
        {
            //Arrange
            var serviceConfigurator = Factory.CreateMp4MetadataServiceConfigurator();

            var metadata = new VideoMetadata()
            {
                AudioBps = serviceConfigurator.AudioBps720P1Channel,
                AudioChannel = AudioChannel.One,
                AudioCodec = "AAC",
                AudioProfile = "LC",
                VideoBps = serviceConfigurator.VideoBps1920X1080,
                VideoCodec = "AVC",
                VideoProfile = "Baseline",
                VideoFps = serviceConfigurator.MaxFps - 1,
                VideoKeyFrame = serviceConfigurator.KeyFrame,
                Width = 4096,
                Height = 2304
            };

            var metadataService = new MetadataService(serviceConfigurator, metadata);

            //Act
            metadataService.AdjustAudioBps();
            metadataService.AdjustAudioCodec();
            metadataService.AdjustAudioProfile();

            //Assert
            Assert.IsTrue(metadataService.CorrectAudioValueList.All((b) => b.Value));
        }
        public void AdjustAudioBpsFor854X480And640X360AndLessX6ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata64Bps = new VideoMetadata()
            {
                Width = 640,
                Height = 360,
                AudioChannel = AudioChannel.Six,
                AudioBps = metadataConfigurator.AudioBps360P6Channel
            };
            var metadataMore64Bps = new VideoMetadata()
            {
                Width = 640,
                Height = 360,
                AudioChannel = AudioChannel.Six,
                AudioBps = metadataConfigurator.AudioBps360P6Channel + 1
            };
            var metadataLess64Bps = new VideoMetadata()
            {
                Width = 640,
                Height = 360,
                AudioChannel = AudioChannel.Six,
                AudioBps = metadataConfigurator.AudioBps360P6Channel - 1
            };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata64Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore64Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess64Bps);

            //Act
            var adjBps64Bps = metadataService1.AdjustAudioBps();
            var adjBpsMore64Bps = metadataService2.AdjustAudioBps();
            var adjBpsLess64Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps360P6Channel, adjBps64Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps360P6Channel, adjBpsMore64Bps);
            Assert.AreEqual(metadataLess64Bps.AudioBps, adjBpsLess64Bps);
        }
        public void AdjustAudioBpsFor1920X1080And1280X720X6ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata512Bps = new VideoMetadata()
            {
                Width = 1280,
                Height = 720,
                AudioChannel = AudioChannel.Six,
                AudioBps = metadataConfigurator.AudioBps720P6Channel
            };
            var metadataMore512Bps = new VideoMetadata()
            {
                Width = 1280,
                Height = 720,
                AudioChannel = AudioChannel.Six,
                AudioBps = metadataConfigurator.AudioBps720P6Channel + 1
            };
            var metadataLess512Bps = new VideoMetadata()
            {
                Width = 1280,
                Height = 720,
                AudioChannel = AudioChannel.Six,
                AudioBps = metadataConfigurator.AudioBps720P6Channel - 1
            };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata512Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore512Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess512Bps);

            //Act
            var adjBps512Bps = metadataService1.AdjustAudioBps();
            var adjBpsMore512Bps = metadataService2.AdjustAudioBps();
            var adjBpsLess512Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps720P6Channel, adjBps512Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps720P6Channel, adjBpsMore512Bps);
            Assert.AreEqual(metadataLess512Bps.AudioBps, adjBpsLess512Bps);
        }
        public void AdjustAudioBpsFor854X480And640X360AndLessX2ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata64Bps = new VideoMediaInfo
                {
                    VideoWidth = 640,
                    VideoHeight = 360,
                    AudioChannels = (int) AudioChannel.Two,
                    AudioBitRate = metadataConfigurator.AudioBps360P2Channel
                };
            var metadataMore64Bps = new VideoMediaInfo
                {
                    VideoWidth = 640,
                    VideoHeight = 360,
                    AudioChannels = (int) AudioChannel.Two,
                    AudioBitRate = metadataConfigurator.AudioBps360P2Channel + 1
                };
            var metadataLess64Bps = new VideoMediaInfo
                {
                    VideoWidth = 640,
                    VideoHeight = 360,
                    AudioChannels = (int) AudioChannel.Two,
                    AudioBitRate = metadataConfigurator.AudioBps360P2Channel - 1
                };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata64Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore64Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess64Bps);

            //Act
            int adjBps64Bps = metadataService1.AdjustAudioBps();
            int adjBpsMore64Bps = metadataService2.AdjustAudioBps();
            int adjBpsLess64Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps360P2Channel, adjBps64Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps360P2Channel, adjBpsMore64Bps);
            Assert.AreEqual(metadataLess64Bps.AudioBitRate, adjBpsLess64Bps);
        }
        public void AdjustAudioBpsFor1920X1080And1280X720X2ChannelSuccessTest()
        {
            //Arrange
            var metadataConfigurator = new MetadataServiceConfigurator(null, null, null, null, null);

            var metadata384Bps = new VideoMediaInfo
                {
                    VideoWidth = 1280,
                    VideoHeight = 720,
                    AudioChannels = (int) AudioChannel.Two,
                    AudioBitRate = metadataConfigurator.AudioBps720P2Channel
                };
            var metadataMore384Bps = new VideoMediaInfo
                {
                    VideoWidth = 1280,
                    VideoHeight = 720,
                    AudioChannels = (int) AudioChannel.Two,
                    AudioBitRate = metadataConfigurator.AudioBps720P2Channel + 1
                };
            var metadataLess384Bps = new VideoMediaInfo
                {
                    VideoWidth = 1280,
                    VideoHeight = 720,
                    AudioChannels = (int) AudioChannel.Two,
                    AudioBitRate = metadataConfigurator.AudioBps720P2Channel - 1
                };
            var metadataService1 = new MetadataService(metadataConfigurator, metadata384Bps);
            var metadataService2 = new MetadataService(metadataConfigurator, metadataMore384Bps);
            var metadataService3 = new MetadataService(metadataConfigurator, metadataLess384Bps);

            //Act
            int adjBps384Bps = metadataService1.AdjustAudioBps();
            int adjBpsMore384Bps = metadataService2.AdjustAudioBps();
            int adjBpsLess384Bps = metadataService3.AdjustAudioBps();

            //Assert
            Assert.AreEqual(metadataConfigurator.AudioBps720P2Channel, adjBps384Bps);
            Assert.AreEqual(metadataConfigurator.AudioBps720P2Channel, adjBpsMore384Bps);
            Assert.AreEqual(metadataLess384Bps.AudioBitRate, adjBpsLess384Bps);
        }
        public void CheckCorrectAudioValueListTest()
        {
            //Arrange
            MetadataServiceConfigurator serviceConfigurator = Factory.CreateMp4MetadataServiceConfigurator();

            var metadata = new VideoMediaInfo
                {
                    AudioBitRate = serviceConfigurator.AudioBps720P1Channel,
                    AudioChannels = (int) AudioChannel.One,
                    AudioFormat = "AAC",
                    AudioFormatProfile = "LC",
                    VideoWidth = 4096,
                    VideoHeight = 2304
                };

            var metadataService = new MetadataService(serviceConfigurator, metadata);

            //Act
            metadataService.AdjustAudioBps();
            metadataService.AdjustAudioCodec();
            metadataService.AdjustAudioProfile();

            //Assert
            Assert.IsTrue(metadataService.CorrectAudioValueList.All((b) => b.Value));
        }