You are here

public function PHPVideoToolkit::setVideoCodec in Video 7

Same name and namespace in other branches
  1. 7.2 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::setVideoCodec()

* Forces the video format for video outputs to a specific codec. This should not be confused with setFormat. setVideoFormat does not generally need to * be called unless setting a specific video format for a type of media format. It gets a little confusing... * * @access public *

Parameters

integer $video_codec Valid values are PHPVideoToolkit::FORMAT_3GP2, PHPVideoToolkit::FORMAT_3GP, PHPVideoToolkit::FORMAT_AVI, PHPVideoToolkit::FORMAT_FLV, PHPVideoToolkit::FORMAT_GIF, PHPVideoToolkit::FORMAT_MJ2, PHPVideoToolkit::FORMAT_MP4, PHPVideoToolkit::FORMAT_MPEG4, PHPVideoToolkit::FORMAT_M4A, PHPVideoToolkit::FORMAT_MPEG, PHPVideoToolkit::FORMAT_MPEG1, PHPVideoToolkit::FORMAT_MPEG2, PHPVideoToolkit::FORMAT_MPEGVIDEO: * @param boolean $validate_codec Queries ffmpeg to see if this codec is available to use. * @return boolean false on error encountered, true otherwise

1 call to PHPVideoToolkit::setVideoCodec()
PHPVideoToolkit::setVideoFormat in libraries/phpvideotoolkit/phpvideotoolkit.php5.php
* @access public * @depreciated *

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 1464

Class

PHPVideoToolkit

Code

public function setVideoCodec($video_codec, $validate_codec = true) {

  //			validate input
  if (!in_array($video_codec, array(
    self::FORMAT_3GP2,
    self::FORMAT_3GP,
    self::FORMAT_AVI,
    self::FORMAT_FLV,
    self::FORMAT_GIF,
    self::FORMAT_MJ2,
    self::FORMAT_MP4,
    self::FORMAT_MPEG4,
    self::FORMAT_M4A,
    self::FORMAT_MPEG,
    self::FORMAT_MPEG1,
    self::FORMAT_MPEG2,
    self::FORMAT_MPEGVIDEO,
  ))) {

    //return $this->_raiseError('setVideoFormat_valid_format', array('format'=>$video_codec));

    //<-			exits
  }

  // 			do we need to validate this codec?
  if ($validate_codec === true) {
    if ($this
      ->canCodecBeEncoded('video', $video_codec) === false) {
      return $this
        ->_raiseError('setVideoFormat_cannnot_encode', array(
        'codec' => $video_codec,
      ));

      //<-		   		exits
    }
  }
  return $this
    ->addCommand('-vcodec', $video_codec);
}