Fix #72 : Add audio and video bitrate settings examples
This commit is contained in:
parent
885618ec27
commit
fca01b0577
1 changed files with 11 additions and 0 deletions
11
README.md
11
README.md
|
|
@ -95,12 +95,18 @@ video. Frames can be extracted.
|
||||||
You can transcode videos using the `FFMpeg\Media\Video:save` method. You will
|
You can transcode videos using the `FFMpeg\Media\Video:save` method. You will
|
||||||
pass a `FFMpeg\Format\FormatInterface` for that.
|
pass a `FFMpeg\Format\FormatInterface` for that.
|
||||||
|
|
||||||
|
Please note that audio and video bitrate are set on the format.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$format = new Format\Video\X264();
|
$format = new Format\Video\X264();
|
||||||
$format->on('progress', function ($video, $format, $percentage) {
|
$format->on('progress', function ($video, $format, $percentage) {
|
||||||
echo "$percentage % transcoded";
|
echo "$percentage % transcoded";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$format
|
||||||
|
-> setKiloBitrate(1000)
|
||||||
|
-> setAudioKiloBitrate(256);
|
||||||
|
|
||||||
$video->save($format, 'video.avi');
|
$video->save($format, 'video.avi');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -200,12 +206,17 @@ video. Frames can be extracted.
|
||||||
You can transcode audios using the `FFMpeg\Media\Audio:save` method. You will
|
You can transcode audios using the `FFMpeg\Media\Audio:save` method. You will
|
||||||
pass a `FFMpeg\Format\FormatInterface` for that.
|
pass a `FFMpeg\Format\FormatInterface` for that.
|
||||||
|
|
||||||
|
Please note that audio kilobitrate is set on the audio format.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$format = new Format\Audio\Flac();
|
$format = new Format\Audio\Flac();
|
||||||
$format->on('progress', function ($$audio, $format, $percentage) {
|
$format->on('progress', function ($$audio, $format, $percentage) {
|
||||||
echo "$percentage % transcoded";
|
echo "$percentage % transcoded";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$format
|
||||||
|
-> setAudioKiloBitrate(256);
|
||||||
|
|
||||||
$audio->save($format, 'track.flac');
|
$audio->save($format, 'track.flac');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue