/** * {@inheritdoc} */ public function apply(Video $video, VideoInterface $format) { $commands = array('-r', $this->rate->getValue()); /** * @see http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping */ if ($format->supportBFrames()) { $commands[] = '-b_strategy'; $commands[] = '1'; $commands[] = '-bf'; $commands[] = '3'; $commands[] = '-g'; $commands[] = $this->gop; } return $commands; }
/** * {@inheritdoc} */ public function apply(Video $video, VideoInterface $format) { $dimensions = null; $commands = array(); foreach ($video->getStreams() as $stream) { if ($stream->isVideo()) { try { $dimensions = $stream->getDimensions(); break; } catch (RuntimeException $e) { } } } if (null !== $dimensions) { $dimensions = $this->getComputedDimensions($dimensions, $format->getModulus()); $commands[] = '-s'; $commands[] = $dimensions->getWidth() . 'x' . $dimensions->getHeight(); } return $commands; }