Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ffprobe streams additional commands #797

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
270f957
First commit for v1.x branch
jens1o Nov 8, 2017
1d22d21
Merge from master
jens1o Nov 8, 2017
1fd7e40
Merge branch 'master' of https://github.com/PHP-FFMpeg/PHP-FFMpeg int…
jens1o Nov 8, 2017
998bab3
jump to phpunit 6.4 and fix some tests(not all)
jens1o Nov 8, 2017
c35cc66
Use expectException and expectExceptionMessage
carusogabriel Dec 13, 2017
c35ff23
Use fluent interface when defining mocks
carusogabriel Dec 13, 2017
11028c1
Fix type hints
carusogabriel Dec 13, 2017
d4a9f00
Use assertSame
carusogabriel Dec 13, 2017
441b49b
Fix tests
carusogabriel Dec 14, 2017
56f3b39
fix test
jens1o Dec 14, 2017
648bb8b
Merge pull request #455 from carusogabriel/phpunit-6
jens1o Dec 14, 2017
7f54f01
Revert "Fix more tests in PHPUnit 6"
jens1o Dec 14, 2017
8af39a2
Merge pull request #457 from PHP-FFMpeg/revert-455-phpunit-6
jens1o Dec 14, 2017
407a626
Use fluent interface when defining mocks
carusogabriel Dec 13, 2017
6c76ffa
Merge pull request #458 from carusogabriel/fix-mocks-tests
jens1o Dec 16, 2017
4657994
Fix Expect Exception tests
carusogabriel Dec 16, 2017
d261100
Merge pull request #459 from carusogabriel/fix-expect-exception
jens1o Dec 16, 2017
077acbf
more codestyle changes
jens1o Jan 8, 2018
410e8d6
pull...
jens1o Jan 8, 2018
52ecddc
use short array syntax
jens1o Jan 8, 2018
0ad5dbf
fix phpdoc in FormatInterface
jens1o Jan 8, 2018
eb1bf88
use cache id and set minimum required limit for php to 7.1
jens1o Jan 9, 2018
222d9ef
remove docs, update gitignore and fix tests
jens1o Jan 9, 2018
d8b870c
fix doc in OptionsTester
jens1o Jan 9, 2018
c3ddef1
move from DoctrineCache to Psr\SimpleCache
jens1o Jan 9, 2018
e5f584a
let travis test against nightly and no longer against 7.0
jens1o Jan 9, 2018
d0fd2c8
allow failures against php nightly
jens1o Jan 9, 2018
9af2878
use strictly checks where possible
jens1o Jan 9, 2018
3c39277
major codestyle changes
jens1o Jan 11, 2018
b068946
codestyle changes
jens1o Jan 17, 2018
5989c20
fix more codestyle bugs
jens1o Jan 17, 2018
bd862b4
Codestyle
jens1o Jan 18, 2018
ca043a4
added class doc
jens1o Jan 18, 2018
c4d69a2
added myself to the maintainers and tiny codestyle change(s)
jens1o Jan 18, 2018
d7645e5
fixed some tests
jens1o Jan 18, 2018
d4920b2
more code cleanup
jens1o Jan 23, 2018
263aab1
codestyle and documentation in filter classes (and tests)
jens1o Jan 23, 2018
fb2432f
I love cleanups in critical stuff
jens1o Jan 23, 2018
ab319c7
fix conditions and more codestyle and refactor tests
jens1o Jan 23, 2018
6394e27
codestyle
jens1o Jan 24, 2018
3057c23
codestyle
jens1o Jan 24, 2018
bd95531
use psr-2
jens1o Jan 24, 2018
eb49d1d
check for codestyle errors while travis build
jens1o Jan 24, 2018
a19cd69
applied codefixes from psr-2
jens1o Jan 24, 2018
9374efd
fixed some false expressions
jens1o Jan 24, 2018
41b0e64
Doc improvement and fixes #322
jens1o Jan 26, 2018
4ed4622
first implementation of codectester
jens1o Jan 26, 2018
94fcb02
do not show random test files
jens1o Jan 26, 2018
8cfa729
fixed some tests
jens1o Jan 26, 2018
ca522dd
fix codestyle
jens1o Jan 26, 2018
54bc685
fix codestyle
jens1o Jan 26, 2018
1c218ba
make use of the codectester and update dependencies.
jens1o Jan 26, 2018
75f587e
fix codestyle
jens1o Jan 26, 2018
6d73d04
fixes https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/470
jens1o Jan 27, 2018
8092045
speedup test by using a smaller test-file
jens1o Jan 27, 2018
8cd9303
use official version of neutron/temporary-filesystem
cb8 Feb 8, 2018
68c5e6f
Merge pull request #482 from cb8/tmpfs
jens1o Feb 8, 2018
a8bd4a7
Added the image to video conversion filter.
pralhadstha May 6, 2018
6a7d3c3
Adding the unit test for the image to video conversion filter.
pralhadstha May 6, 2018
9290f6e
PSR fixes according to travis.
pralhadstha May 6, 2018
531a4a3
Changed the audiointerface class for mock with v1.x
pralhadstha May 6, 2018
43405c6
Added some method changes and typehinting.
pralhadstha May 7, 2018
4705f8a
Updated with the beautiful styles.
pralhadstha May 12, 2018
7f2f589
Some changes to remove the default value of preset and make preset ch…
pralhadstha May 14, 2018
3ed8c72
updating the failed test function to the original one.
pralhadstha May 16, 2018
6840c17
Moved to PHPUnit 7.1, PHP 7.1, removed silex and sami support, fix te…
jens1o Dec 24, 2018
065fece
Fixed tests/UnitMedia/VideoTest.php
jens1o Dec 24, 2018
accff79
Fixed tests/Unit/Media/WaveformTest.php
jens1o Dec 24, 2018
9def251
Fixed tests/Unit/Media/*.php
jens1o Dec 24, 2018
eb08c81
Fix tests/Unit/Format/*
jens1o Dec 24, 2018
297bbd8
Fixed all tests and removed deprecated/old documentation
jens1o Dec 24, 2018
f0f0790
Introduced TPriorityFilter, cleanup, documentation work, typehinting
jens1o Dec 24, 2018
0337876
General cleanup, updated codestyle, started type-hinting
jens1o Jan 2, 2019
4d7b5ec
fix #618, further cleanup
jens1o Jan 2, 2019
f9da525
More type-hinting while experiencing weird things in the codebase
jens1o Jan 2, 2019
538ac36
wip
jens1o Feb 16, 2019
3d80e2d
Manually merge https://github.com/PHP-FFMpeg/PHP-FFMpeg/pull/533 into…
jens1o Mar 17, 2019
1c5a1fe
Fix https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/638 by validating…
jens1o Mar 30, 2019
bad53e1
Cleanup
jens1o Apr 11, 2019
68f2eec
Introduce IVideoOwned and TVideoOwned, further cleanup
jens1o Apr 13, 2019
990ab01
Introduce IAudioOwned/TAudioOwned and further cleanup on array usage
jens1o Apr 13, 2019
16b59a5
Cleanup, codestyle change
jens1o May 5, 2019
2d6943c
Got rid of old array()-notation. :tada:
jens1o May 5, 2019
e559f63
fix syntax and invalid usages with creating weird dimensions
jens1o May 5, 2019
0cb98bb
File formatting
jens1o Sep 29, 2019
77917b7
Add travis ci building on this branch
jens1o Sep 29, 2019
d0af4f9
Only build on 7.1 and newer
jens1o Sep 29, 2019
a8985ee
Fix tests
jens1o Sep 29, 2019
6ed1de8
Do not test against PHP 8, yet.
jens1o Sep 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
| -------------- | ---
| Bug? | no
| New Feature? | no
| Version Used | Specific tag or commit sha
| FFmpeg Version | FFmpeg or AVConv and version
| Version used | Specific tag or commit sha
| FFMpeg version | FFmpeg or AVConv and version
| OS | Your OS and version

#### Actual Behavior
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ composer.phar
composer.lock
phpunit.xml
sami.phar
.idea/
.idea/
/build/coverage-report/
20 changes: 0 additions & 20 deletions .sami.php

This file was deleted.

8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,21 @@ dist: trusty
branches:
only:
- master
- v1.x
- v1

cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3

matrix:
include:
- php: 5.4
- php: 7.1
env: COMPOSER_FLAGS="--prefer-lowest"

before_install:
Expand Down
56 changes: 15 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ paths explicitly, you can pass an array as configuration. A `Psr\Logger\LoggerIn
can also be passed to log binary executions.

```php
$ffmpeg = FFMpeg\FFMpeg::create(array(
$ffmpeg = FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg',
'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe',
'timeout' => 3600, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
), $logger);
], $logger);
```

### Manipulate media
Expand Down Expand Up @@ -200,7 +200,7 @@ documentation below for more information.
The output file MUST use the PNG extension.

```php
$waveform = $audio->waveform(640, 120, array('#00FF00'));
$waveform = $audio->waveform(640, 120, ['#00FF00']);
$waveform->save('waveform.png');
```

Expand Down Expand Up @@ -293,11 +293,11 @@ Watermark a video with a given image.
```php
$video
->filters()
->watermark($watermarkPath, array(
->watermark($watermarkPath, [
'position' => 'relative',
'bottom' => 50,
'right' => 50,
));
]);
```

The watermark filter takes two parameters:
Expand All @@ -308,11 +308,11 @@ The watermark filter takes two parameters:
```php
$video
->filters()
->watermark($watermarkPath, array(
->watermark($watermarkPath, [
'position' => 'absolute',
'x' => 1180,
'y' => 620,
));
]);
```

###### Framerate
Expand All @@ -326,7 +326,7 @@ $video->filters()->framerate($framerate, $gop);
The framerate filter takes two parameters:

- `$framerate`, an instance of `FFMpeg\Coordinate\Framerate`
- `$gop`, a [GOP](https://wikipedia.org/wiki/Group_of_pictures) value (integer)
- `$gop`, a [GOP](https://wikipedia.org/wiki/Group_of_pictures) value (int)

###### Synchronize

Expand Down Expand Up @@ -442,7 +442,7 @@ $audio->filters()->resample($rate);

The resample filter takes two parameters :

- `$rate`, a valid audio sample rate value (integer)
- `$rate`, a valid audio sample rate value (int)

#### Frame

Expand Down Expand Up @@ -497,8 +497,8 @@ To concatenate videos encoded with the same codec, do as follow:
// We recommend that you put there the path of any of the video you want to use in this concatenation.
$video = $ffmpeg->open( '/path/to/video' );
$video
->concat(array('/path/to/video1', '/path/to/video2'))
->saveFromSameCodecs('/path/to/new_file', TRUE);
->concat(['/path/to/video1', '/path/to/video2'])
->saveFromSameCodecs('/path/to/new_file', true);
```

The boolean parameter of the save function allows you to use the copy parameter which accelerates drastically the generation of the encoded file.
Expand All @@ -514,7 +514,7 @@ $format = new FFMpeg\Format\Video\X264();
$format->setAudioCodec("libmp3lame");

$video
->concat(array('/path/to/video1', '/path/to/video2'))
->concat(['/path/to/video1', '/path/to/video2'])
->saveFromDifferentCodecs($format, '/path/to/new_file');
```

Expand Down Expand Up @@ -550,7 +550,7 @@ The argument of the setAdditionalParameters method is an array.

```php
$format = new FFMpeg\Format\Video\X264();
$format->setAdditionalParameters(array('foo', 'bar'));
$format->setAdditionalParameters(['foo', 'bar']);
$video->save($format, 'video.avi');
```

Expand All @@ -577,12 +577,12 @@ class CustomWMVFormat extends FFMpeg\Format\Video\DefaultVideo

public function getAvailableAudioCodecs()
{
return array('wmav2');
return ['wmav2'];
}

public function getAvailableVideoCodecs()
{
return array('wmv2');
return ['wmv2'];
}
}
```
Expand Down Expand Up @@ -628,32 +628,6 @@ $ffprobe = FFMpeg\FFProbe::create();
$ffprobe->isValid('/path/to/file/to/check'); // returns bool
```

## Using with Silex Microframework

The service provider is easy to set up:

```php
$app = new Silex\Application();
$app->register(new FFMpeg\FFMpegServiceProvider());

$video = $app['ffmpeg']->open('video.mpeg');
```

Available options are as follow:

```php
$app->register(new FFMpeg\FFMpegServiceProvider(), array(
'ffmpeg.configuration' => array(
'ffmpeg.threads' => 4,
'ffmpeg.timeout' => 300,
'ffmpeg.binaries' => '/opt/local/ffmpeg/bin/ffmpeg',
'ffprobe.timeout' => 30,
'ffprobe.binaries' => '/opt/local/ffmpeg/bin/ffprobe',
),
'ffmpeg.logger' => $logger,
));
```

## License

This project is licensed under the [MIT license](http://opensource.org/licenses/MIT).
Expand Down
28 changes: 18 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"name": "php-ffmpeg/php-ffmpeg",
"type": "library",
"description": "FFMpeg PHP, an Object Oriented library to communicate with AVconv / ffmpeg",
"keywords": ["video processing", "video", "audio processing", "audio", "avconv", "ffmpeg", "avprobe", "ffprobe"],
"keywords": [
"video processing",
"video",
"audio processing",
"audio",
"avconv",
"ffmpeg",
"avprobe",
"ffprobe"
],
"license": "MIT",
"authors": [
{
Expand Down Expand Up @@ -32,19 +41,18 @@
}
],
"require": {
"php": "^5.3.9 || ^7.0",
"alchemy/binary-driver": "^1.5 || ~2.0.0 || ^5.0",
"doctrine/cache": "^1.0",
"evenement/evenement": "^2.0 || ^1.0",
"neutron/temporary-filesystem": "^2.1.1"
"php": "^7.1",
"alchemy/binary-driver": "^2.0.0",
"sabre/cache": "^1.0",
"evenement/evenement": "^2.0",
"neutron/temporary-filesystem": "^2.3"
},
"suggest": {
"php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg"
},
"require-dev": {
"sami/sami": "~1.0",
"silex/silex": "~1.0",
"phpunit/phpunit": "^4.8.36"
"phpunit/phpunit": "^7",
"squizlabs/php_codesniffer": "3.*"
},
"autoload": {
"psr-0": {
Expand All @@ -61,4 +69,4 @@
"dev-master": "0.7-dev"
}
}
}
}
50 changes: 0 additions & 50 deletions docs/source/API/API/FFMpeg.html

This file was deleted.

59 changes: 0 additions & 59 deletions docs/source/API/API/FFMpeg/Coordinate.html

This file was deleted.