You are here

public function PHPVideoToolkit::setFormat in Video 7.2

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

Sets the new video format.

@access public

Parameters

$format: The format should use one of the defined variables stated below. PHPVideoToolkit::FORMAT_3GP2 - 3g2 PHPVideoToolkit::FORMAT_3GP - 3gp PHPVideoToolkit::FORMAT_AAC - aac PHPVideoToolkit::FORMAT_AIFF - aiff PHPVideoToolkit::FORMAT_AMR - amr PHPVideoToolkit::FORMAT_ASF - asf PHPVideoToolkit::FORMAT_AVI - avi PHPVideoToolkit::FORMAT_FLV - flv PHPVideoToolkit::FORMAT_GIF - gif PHPVideoToolkit::FORMAT_MJ2 - mj2 PHPVideoToolkit::FORMAT_MP2 - mp2 PHPVideoToolkit::FORMAT_MP3 - mp3 PHPVideoToolkit::FORMAT_MP4 - mp4 PHPVideoToolkit::FORMAT_MPEG4 - mpeg4 PHPVideoToolkit::FORMAT_M4A - m4a PHPVideoToolkit::FORMAT_MPEG - mpeg PHPVideoToolkit::FORMAT_MPEG1 - mpeg1video PHPVideoToolkit::FORMAT_MPEG2 - mpeg2video PHPVideoToolkit::FORMAT_MPEGVIDEO - mpegvideo PHPVideoToolkit::FORMAT_PSP - psp PHPVideoToolkit::FORMAT_RM - rm PHPVideoToolkit::FORMAT_SWF - swf PHPVideoToolkit::FORMAT_VOB - vob PHPVideoToolkit::FORMAT_WAV - wav PHPVideoToolkit::FORMAT_JPG - jpg

Return value

boolean FALSE on error encountered, TRUE otherwise

2 calls to PHPVideoToolkit::setFormat()
PHPVideoToolkit::extractAudio in libraries/phpvideotoolkit/phpvideotoolkit.php5.php
This is an alias for setFormat, but restricts it to audio only formats.
PHPVideoToolkit::setFormatToFLV in libraries/phpvideotoolkit/phpvideotoolkit.php5.php
A shortcut for converting video to FLV.

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 1365
Libary to access FFmpeg

Class

PHPVideoToolkit

Code

public function setFormat($format) {

  //			validate input
  if (!in_array($format, array(
    self::FORMAT_3GP2,
    self::FORMAT_3GP,
    self::FORMAT_AAC,
    self::FORMAT_AIFF,
    self::FORMAT_AMR,
    self::FORMAT_ASF,
    self::FORMAT_AVI,
    self::FORMAT_FLV,
    self::FORMAT_GIF,
    self::FORMAT_MJ2,
    self::FORMAT_MP2,
    self::FORMAT_MP3,
    self::FORMAT_MP4,
    self::FORMAT_MPEG4,
    self::FORMAT_M4A,
    self::FORMAT_MPEG,
    self::FORMAT_MPEG1,
    self::FORMAT_MPEG2,
    self::FORMAT_MPEGVIDEO,
    self::FORMAT_PSP,
    self::FORMAT_RM,
    self::FORMAT_SWF,
    self::FORMAT_VOB,
    self::FORMAT_WAV,
    self::FORMAT_JPG,
  ))) {

    // return $this->_raiseError('setFormat_valid_format', array('format'=>$format));
    // <-			exits
  }
  return $this
    ->addCommand('-f', $format);
}