Skip to content

Commit

Permalink
Prep 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed Jul 7, 2018
1 parent f672e6a commit 3e00d5d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.3.0 (2018-07-xx) TBD
## 0.3.0 (2018-07-08)

### Changed

Expand All @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

- Support for `withSeekStart` and `withSeekEnd` methods.
- Support for `withOverwrite`.


## 0.2.0 (2018-07-06)
Expand Down
47 changes: 35 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Media tools: toolbox for media processing, video conversions, transcoding, trans
- FFmpeg 3.4+, 4.0+

--------------
## Video\ConversionService.
## VideoConversionService.


The `Video\ConvertServiceInterface` offers two ways to convert a video to another one.
Expand Down Expand Up @@ -79,6 +79,7 @@ use Soluble\MediaTools\VideoConversionParams;
use Soluble\MediaTools\Exception as MTException;
$convertParams = (new VideoConversionParams)
->withOverwrite()
->withVideoCodec('libx264')
->withAudioCodec('aac')
->withAudioBitrate('128k')
Expand Down Expand Up @@ -116,7 +117,8 @@ use Soluble\MediaTools\VideoConversionParams;
use Soluble\MediaTools\Exception as MTException;


$convertParams = (new VideoConversionParams())
$convertParams = (new VideoConversionParams)
->withOverwrite()
->withVideoCodec('libvpx-vp9')
->withVideoBitrate('750k')
->withQuality('good')
Expand Down Expand Up @@ -146,22 +148,43 @@ try {
/** @var \Soluble\MediaTools\Video\ConversionServiceInterface $videoConverter */
$videoConverter->convert('/path/inputFile.mov', '/path/outputFile.webm', $convertParams);
} catch(MTException\ProcessConversionException $e) {

// The ffmpeg 'symfony' process encountered a failure...
// To see the reason you can either use:
echo $e->getMessage(); // full message
echo $e->getProcess()->getErrorOutput(); // process stdErr
echo $e->wasCausedByTimeout() ? 'timeout' : '';
echo $e->wasCausedBySignal() ? 'interrupted' : '';

// ...
} catch (MTException\FileNotFoundException $e) {
echo "The input file does not exists";
}

```

#### Time crop

> See the official [ffmpeg VP9 docs](https://trac.ffmpeg.org/wiki/Encode/VP9)
> and have a look at the [google vp9 VOD](https://developers.google.com/media/vp9/settings/vod/#ffmpeg_command_lines) guidelines

```php
<?php
use Soluble\MediaTools\VideoConversionParams;
use Soluble\MediaTools\Video\SeekTime;
use Soluble\MediaTools\Exception as MTException;

$convertParams = (new VideoConversionParams)
->withOverwrite()
->withSeekStart(new SeekTime(10.242)) // 10 sec, 242 milli
->withSeekEnd(SeekTime::createFromHMS('12:52.015')); // 12 mins, 52 secs...

try {
/** @var \Soluble\MediaTools\Video\ConversionServiceInterface $videoConverter */
$videoConverter->convert('/path/inputFile.mp4', '/path/outputFile.mp4', $convertParams);
} catch(MTException\ProcessConversionException $e) {
// ...
} catch (MTException\FileNotFoundException $e) {
echo "The input file does not exists";
}

```

----------------------
## Video\ThumbService
## VideoThumbService

### Recipes

Expand Down Expand Up @@ -202,7 +225,7 @@ try {
```
----------------------
## Video\DetectionService service.
## VideoDetectionService.


### Recipes
Expand Down

0 comments on commit 3e00d5d

Please sign in to comment.