bitmovin / bitmovin-php
PHP-Client which enables you to seamlessly integrate the Bitmovin API into your existing projects
Installs: 55 041
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 22
Forks: 13
Open Issues: 14
Requires
- php: >=5.6.0
- guzzlehttp/guzzle: ^6.0
- icecave/parity: 1.0.0
- jms/serializer: ^1.3
Requires (Dev)
- phpunit/phpunit: ^4.8
- ramsey/uuid: 3.5.1
- dev-master
- v1.5.25
- v1.5.24
- v1.5.23
- v1.5.22
- v1.5.20
- v1.5.19
- v1.5.18
- v1.5.17
- v1.5.16
- v1.5.15
- v1.5.14
- v1.5.13
- v1.5.12
- v1.5.11
- v1.5.10
- v1.5.9
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.1
- v1.5.0
- v1.4.24
- v1.4.23
- v1.4.22
- v1.4.21
- v1.4.20
- v1.4.19
- v1.4.18
- v1.4.17
- v1.4.16
- v1.4.15
- v1.4.14
- v1.4.13
- v1.4.12
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.5
- v1.3.4
- v1.3.2
- v1.3.0
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/composer/guzzlehttp/psr7-1.9.1
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-develop
- dev-feature/addEncodingModeSinglePass
- dev-feature/add_specific_resource_webhooks
- dev-feature/bump-version
- dev-feature/add-ivsize-to-cenc
- dev-feature/lock-to-5dot6
- dev-feature/add-ace-eac3
- dev-feature/fix-custom-tag-mediainfo
- dev-feature/add-keyframes-manifest-decoration
- dev-feature/addPsshToPlayreadyCENC
- dev-feature/cencPlayreadyPSSH
- dev-feature/start-encoding-request
- dev-TS-and-FMP4-HLS-code-example
- dev-feature/multicodecWithTimeOffsetExample
- dev-feature/fix_hls_example
- dev-feature/timeOffsetSimplified
- dev-feature/conditionMode
- dev-s3-and-ftp
This package is auto-updated.
Last update: 2025-02-19 23:15:28 UTC
README
New API Client (Recommended)
bitmovin-php
is the legacy Bitmovin API client for PHP.
We recommend using the new client, which you can find at bitmovin-api-sdk-php. Using the new client guarantees 100% specification conformity at any given time and access to all features of the API as soon as they are released.
bitmovin-php
PHP-Client which enables you to seamlessly integrate the Bitmovin API into your projects. Using this API client requires an active account. Sign up for a Bitmovin API key.
The full Bitmovin API reference can be found on our website.
Installation
Requirements: PHP 5.6.0 or higher is required
Composer
To install the api-client with composer, add the following to your composer.json
file:
{ "require": { "bitmovin/bitmovin-php": "1.5.*" } }
Then run php composer.phar install
OR
run the following command: php composer.phar require bitmovin/bitmovin-php:1.5.*
Example
The following example creates a simple transcoding job and transfers it to a GCS output location (CreateSimpleEncoding.php):
<?php use Bitmovin\api\enum\CloudRegion; use Bitmovin\BitmovinClient; use Bitmovin\configs\audio\AudioStreamConfig; use Bitmovin\configs\EncodingProfileConfig; use Bitmovin\configs\JobConfig; use Bitmovin\configs\manifest\DashOutputFormat; use Bitmovin\configs\manifest\HlsOutputFormat; use Bitmovin\configs\video\H264VideoStreamConfig; use Bitmovin\input\HttpInput; use Bitmovin\output\GcsOutput; require_once __DIR__ . '/vendor/autoload.php'; $client = new BitmovinClient('INSERT YOUR API KEY HERE'); // CONFIGURATION $videoInputPath = 'http://eu-storage.bitcodin.com/inputs/Sintel.2010.720p.mkv'; $gcs_accessKey = 'INSERT YOUR GCS OUTPUT ACCESS KEY HERE'; $gcs_secretKey = 'INSERT YOUR GCS OUTPUT SECRET KEY HERE'; $gcs_bucketName = 'INSERT YOUR GCS OUTPUT BUCKET NAME HERE'; $gcs_prefix = 'path/to/your/output/destination/'; // CREATE ENCODING PROFILE $encodingProfile = new EncodingProfileConfig(); $encodingProfile->name = 'Test Encoding'; $encodingProfile->cloudRegion = CloudRegion::GOOGLE_EUROPE_WEST_1; // CREATE VIDEO STREAM CONFIG FOR 1080p $videoStreamConfig_1080 = new H264VideoStreamConfig(); $videoStreamConfig_1080->input = new HttpInput($videoInputPath); $videoStreamConfig_1080->width = 1920; $videoStreamConfig_1080->height = 1080; $videoStreamConfig_1080->bitrate = 4800000; $videoStreamConfig_1080->rate = 25.0; $encodingProfile->videoStreamConfigs[] = $videoStreamConfig_1080; // CREATE VIDEO STREAM CONFIG FOR 720p $videoStreamConfig_720 = new H264VideoStreamConfig(); $videoStreamConfig_720->input = new HttpInput($videoInputPath); $videoStreamConfig_720->width = 1280; $videoStreamConfig_720->height = 720; $videoStreamConfig_720->bitrate = 2400000; $videoStreamConfig_720->rate = 25.0; $encodingProfile->videoStreamConfigs[] = $videoStreamConfig_720; // CREATE AUDIO STREAM CONFIG $audioConfig = new AudioStreamConfig(); $audioConfig->input = new HttpInput($videoInputPath); $audioConfig->bitrate = 128000; $audioConfig->rate = 48000; $audioConfig->name = 'English'; $audioConfig->lang = 'en'; $audioConfig->position = 1; $encodingProfile->audioStreamConfigs[] = $audioConfig; // CREATE JOB CONFIG $jobConfig = new JobConfig(); // ASSIGN OUTPUT $jobConfig->output = new GcsOutput($gcs_accessKey, $gcs_secretKey, $gcs_bucketName, $gcs_prefix); // ASSIGN ENCODING PROFILES TO JOB $jobConfig->encodingProfile = $encodingProfile; // ENABLE DASH OUTPUT $jobConfig->outputFormat[] = new DashOutputFormat(); // ENABLE HLS OUTPUT $jobConfig->outputFormat[] = new HlsOutputFormat(); // RUN JOB AND WAIT UNTIL IT HAS FINISHED $client->runJobAndWaitForCompletion($jobConfig);
For more examples go to our example page.