src/BaiduBce/Services/Media/MediaClient.php
public function createPreset($presetName, $container, $options = array())
    {
        list($config) = $this->parseOptionsIgnoreExtra(
            $options,
            'config'
        );

        if (empty($presetName)) {
            throw new BceClientException("The parameter presetName " 
                ."should NOT be null or empty string");
        }

        if (empty($container)) {
            throw new BceClientException("The parameter container " 
                ."should NOT be null or empty string");
        }

        if (!empty($config)) {
            unset($options['config']);
        }
        $body = $options;
        $body['presetName'] = $presetName;
        $body['container'] = $container;

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body),
            ),
            '/preset'
        );
    }
public function createPreset($presetName, $container, $options = array())
    {
        list($config) = $this->parseOptionsIgnoreExtra(
            $options,
            'config'
        );

        if (empty($presetName)) {
            throw new BceClientException("The parameter presetName " 
                ."should NOT be null or empty string");
        }

        if (empty($container)) {
            throw new BceClientException("The parameter container " 
                ."should NOT be null or empty string");
        }

        if (!empty($config)) {
            unset($options['config']);
        }
        $body = $options;
        $body['presetName'] = $presetName;
        $body['container'] = $container;

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body),
            ),
            '/preset'
        );
    }
public function createPreset ( $ presetName , $ container , $ options = array ( ) ) { list ( $ config ) = $ this -> parseOptionsIgnoreExtra ( $ options , 'config' ) ; if ( empty ( $ presetName ) ) { throw new BceClientException ( "The parameter presetName " . "should NOT be null or empty string" ) ; } if ( empty ( $ container ) ) { throw new BceClientException ( "The parameter container " . "should NOT be null or empty string" ) ; } if ( ! empty ( $ config ) ) { unset ( $ options [ 'config' ] ) ; } $ body = $ options ; $ body [ 'presetName' ] = $ presetName ; $ body [ 'container' ] = $ container ; return $ this -> sendRequest ( HttpMethod :: POST , array ( 'config' => $ config , 'body' => json_encode ( $ body ) , ) , '/preset' ) ; }
Create a preset

@param string $presetName The preset's name
@param string $container enum(MP4, FLV, HLS, MP3, M4A)
@param array $options Supported options:
{
config: The optional bce configuration, which will overwrite the
default client configuration that was passed in constructor.
description: The preset's description
transmux(boolean): whether only preceed format transformation
clip: {   cut the video or audio
startTimeInSecond: The start time from video
durationInSecond: The duration time from video in seconds
}
audio: {  audio preceeding set, default to be video preceeding only
bitRateInBps: The target audio bit rate
sampleRateInHz:
channels: The number of audio's channels
}
video: {  video proceeding set, default to be audio preceeding only
codec: H.264
codecOptions: {
profile: enum(baseline, main, high)
}
bitRateInBps: The target video bit rate
maxFrameRate: The max frame rate, enum(10,15, 23.97, 24, 25, 29.97, 30, 50, 60)
maxWidthInPixel: The target video's max width in pixel, range(128, 4096)
maxHeightInPixel: The target video's max height in pixel, range(96, 3072)
sizingPolicy: enum(Keep, ShrinkToFit, Stretch)
}
encryption: {
strategy: enum(Fixed)
aesKey: The aes 128-bit secret key
}
watermarkId: watermarkId
}
@return mixed
@throws BceClientException
Create a preset