public function __construct(TranslatorInterface $translator) { parent::__construct($translator); $this->registerOption(new OptionType\Range($this->translator->trans('Bitrate'), self::OPTION_BITRATE, 100, 12000, 800)); $this->registerOption(new OptionType\Range($this->translator->trans('GOP size'), self::OPTION_GOPSIZE, 1, 300, 10)); $this->registerOption(new OptionType\Range($this->translator->trans('Dimension'), self::OPTION_SIZE, 64, 2000, 600, 16)); $this->registerOption(new OptionType\Range($this->translator->trans('Frame Rate'), self::OPTION_FRAMERATE, 1, 200, 20)); $this->registerOption(new OptionType\Enum($this->translator->trans('Video Codec'), self::OPTION_VCODEC, ['libx264', 'libvpx', 'libtheora'], 'libx264')); $this->unregisterOption(self::OPTION_ACODEC); $this->registerOption(new OptionType\Enum($this->translator->trans('Audio Codec'), self::OPTION_ACODEC, ['libfaac', 'libvo_aacenc', 'libmp3lame', 'libvorbis'], 'libfaac')); }
/** * Build Audio Subdef object depending the SimpleXMLElement * * @param SimpleXMLElement $sd * @return \Alchemy\Phrasea\Media\Subdef\Video */ protected function buildAudioSubdef(SimpleXMLElement $sd) { $audio = new Audio($this->translator); if ($sd->acodec) { $audio->setOptionValue(Audio::OPTION_ACODEC, (string) $sd->acodec); } if ($sd->audiobitrate) { $audio->setOptionValue(Audio::OPTION_AUDIOBITRATE, (int) $sd->audiobitrate); } if ($sd->audiosamplerate) { $audio->setOptionValue(Audio::OPTION_AUDIOSAMPLERATE, (int) $sd->audiosamplerate); } return $audio; }
/** * @covers Alchemy\Phrasea\Media\Subdef\Audio::getMediaAlchemystSpec */ public function testGetMediaAlchemystSpec() { $this->assertInstanceOf('\\MediaAlchemyst\\Specification\\Audio', $this->object->getMediaAlchemystSpec()); }