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')); } public function getType() { return self::TYPE_VIDEO; } public function getDescription() { return $this->translator->trans('Generates a video file'); } public function getMediaAlchemystSpec() { if (! $this->spec) { $this->spec = new \MediaAlchemyst\Specification\Video(); } $size = $this->getOption(self::OPTION_SIZE)->getValue(); $this->spec->setAudioCodec($this->getOption(self::OPTION_ACODEC)->getValue()); $this->spec->setAudioSampleRate($this->getOption(self::OPTION_AUDIOSAMPLERATE)->getValue()); $this->spec->setAudioKiloBitrate($this->getOption(self::OPTION_AUDIOBITRATE)->getValue()); $this->spec->setKiloBitrate($this->getOption(self::OPTION_BITRATE)->getValue()); $this->spec->setVideoCodec($this->getOption(self::OPTION_VCODEC)->getValue()); $this->spec->setDimensions($size, $size); $this->spec->setFramerate($this->getOption(self::OPTION_FRAMERATE)->getValue()); $this->spec->setGOPSize($this->getOption(self::OPTION_GOPSIZE)->getValue()); return $this->spec; } }