├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── phpunit.xml.dist ├── src └── FFMpeg │ └── Format │ └── Video │ └── ThreeGP.php └── tests ├── output └── .gitkeep ├── ressources └── test.mp4 └── src └── FFMpeg ├── Encode └── ThreeGP │ └── ThreeGPTest.php └── Format └── Video └── ThreeGPTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | /nbproject 2 | /vendor 3 | /tests/phpunit_report 4 | composer.phar 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | before_script: 4 | - sudo apt-get update 5 | - sudo apt-get install -y ffmpeg libavcodec-extra-53 6 | - composer self-update 7 | - composer install --no-interaction --prefer-source --dev 8 | 9 | php: 10 | - 5.3.3 11 | - 5.3 12 | - 5.4 13 | - 5.5 14 | - 5.6 15 | - hhvm 16 | 17 | script: 18 | - vendor/bin/phpunit --verbose 19 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | --------- 3 | 4 | * 0.3.1 (02-24-2014) 5 | 6 | * Fix composer compatibility with PHP-FFMpeg versions 7 | 8 | * 0.3.0 (07-04-2013) 9 | 10 | * Update to FFMpeg version 0.3. 11 | 12 | * 0.2.0 (07-03-2013) 13 | 14 | * Update to FFMpeg version 0.2. 15 | 16 | * 0.1.0 (10-30-2012) 17 | 18 | * First stable version. 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | PHP-FFmpeg extras is released with MIT License : 2 | 3 | Copyright (c) 2012 Alchemy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 | IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PHP-FFMPEG-Extras 2 | ================= 3 | 4 | PHP-FFMPEG-Extras is a repository where the most common video & audio 5 | formats for [PHP-FFMpeg](https://github.com/PHP-FFMpeg/PHP-FFMpeg) are available. 6 | 7 | ## Available formats are: 8 | - 3GP. 9 | 10 | ## Todo: 11 | - Video 12 | - FLV 13 | - AVI 14 | - WMV 15 | - AMV 16 | - DIVX 17 | 18 | - Audio 19 | - OGG 20 | 21 | ## License 22 | This project is released under the MIT License 23 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "php-ffmpeg/extras", 3 | "type": "library", 4 | "description": "A set of audio/video formats compatible with PHP-FFMpeg", 5 | "keywords": ["ffmpeg", "codecs"], 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Phraseanet Team", 10 | "email": "dev.team@alchemy.fr", 11 | "homepage": "http://www.phraseanet.com/" 12 | } 13 | ], 14 | "require": { 15 | "php": ">=5.3.2", 16 | "php-ffmpeg/php-ffmpeg" : "~0.3" 17 | }, 18 | "require-dev": { 19 | "sami/sami" : "~1.0", 20 | "phpunit/phpunit" : "~3.7" 21 | }, 22 | "autoload": { 23 | "psr-0": { 24 | "FFMpeg": "src" 25 | } 26 | }, 27 | "extra": { 28 | "branch-alias": { 29 | "dev-master": "0.3-dev" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" 5 | ], 6 | "hash": "e8366c9ce6b5f1fa036e05d399b62f54", 7 | "packages": [ 8 | { 9 | "name": "alchemy/binary-driver", 10 | "version": "1.5.0", 11 | "source": { 12 | "type": "git", 13 | "url": "https://github.com/alchemy-fr/BinaryDriver.git", 14 | "reference": "1.5.0" 15 | }, 16 | "dist": { 17 | "type": "zip", 18 | "url": "https://api.github.com/repos/alchemy-fr/BinaryDriver/zipball/1.5.0", 19 | "reference": "1.5.0", 20 | "shasum": "" 21 | }, 22 | "require": { 23 | "evenement/evenement": ">=1.0,<2.0", 24 | "monolog/monolog": ">=1.3,<2.0", 25 | "php": ">=5.3.3", 26 | "psr/log": ">=1.0,<2.0", 27 | "symfony/process": ">=2.0,<3.0" 28 | }, 29 | "require-dev": { 30 | "phpunit/phpunit": ">=3.7,<4.0" 31 | }, 32 | "type": "library", 33 | "autoload": { 34 | "psr-0": { 35 | "Alchemy": "src" 36 | } 37 | }, 38 | "notification-url": "https://packagist.org/downloads/", 39 | "license": [ 40 | "MIT" 41 | ], 42 | "authors": [ 43 | { 44 | "name": "Romain Neutron", 45 | "email": "imprec@gmail.com", 46 | "homepage": "http://www.lickmychip.com/" 47 | }, 48 | { 49 | "name": "nlegoff", 50 | "email": "legoff.n@gmail.com" 51 | }, 52 | { 53 | "name": "Phraseanet Team", 54 | "email": "info@alchemy.fr", 55 | "homepage": "http://www.phraseanet.com/" 56 | } 57 | ], 58 | "description": "A set of tools to build binary drivers", 59 | "keywords": [ 60 | "binary", 61 | "driver" 62 | ], 63 | "time": "2013-06-21 15:51:20" 64 | }, 65 | { 66 | "name": "doctrine/cache", 67 | "version": "v1.0", 68 | "source": { 69 | "type": "git", 70 | "url": "https://github.com/doctrine/cache.git", 71 | "reference": "v1.0" 72 | }, 73 | "dist": { 74 | "type": "zip", 75 | "url": "https://github.com/doctrine/cache/archive/v1.0.zip", 76 | "reference": "v1.0", 77 | "shasum": "" 78 | }, 79 | "require": { 80 | "php": ">=5.3.2" 81 | }, 82 | "type": "library", 83 | "autoload": { 84 | "psr-0": { 85 | "Doctrine\\Common\\Cache\\": "lib/" 86 | } 87 | }, 88 | "notification-url": "https://packagist.org/downloads/", 89 | "license": [ 90 | "MIT" 91 | ], 92 | "authors": [ 93 | { 94 | "name": "Jonathan Wage", 95 | "email": "jonwage@gmail.com", 96 | "homepage": "http://www.jwage.com/" 97 | }, 98 | { 99 | "name": "Guilherme Blanco", 100 | "email": "guilhermeblanco@gmail.com", 101 | "homepage": "http://www.instaclick.com" 102 | }, 103 | { 104 | "name": "Roman Borschel", 105 | "email": "roman@code-factory.org" 106 | }, 107 | { 108 | "name": "Benjamin Eberlei", 109 | "email": "kontakt@beberlei.de" 110 | }, 111 | { 112 | "name": "Johannes Schmitt", 113 | "email": "schmittjoh@gmail.com", 114 | "homepage": "http://jmsyst.com", 115 | "role": "Developer of wrapped JMSSerializerBundle" 116 | } 117 | ], 118 | "description": "Caching library offering an object-oriented API for many cache backends", 119 | "homepage": "http://www.doctrine-project.org", 120 | "keywords": [ 121 | "cache", 122 | "caching" 123 | ], 124 | "time": "2013-01-10 22:43:46" 125 | }, 126 | { 127 | "name": "evenement/evenement", 128 | "version": "v1.0.0", 129 | "source": { 130 | "type": "git", 131 | "url": "https://github.com/igorw/evenement", 132 | "reference": "v1.0.0" 133 | }, 134 | "dist": { 135 | "type": "zip", 136 | "url": "https://github.com/igorw/evenement/zipball/v1.0.0", 137 | "reference": "v1.0.0", 138 | "shasum": "" 139 | }, 140 | "require": { 141 | "php": ">=5.3.0" 142 | }, 143 | "type": "library", 144 | "autoload": { 145 | "psr-0": { 146 | "Evenement": "src" 147 | } 148 | }, 149 | "notification-url": "https://packagist.org/downloads/", 150 | "license": [ 151 | "MIT" 152 | ], 153 | "authors": [ 154 | { 155 | "name": "Igor Wiedler", 156 | "email": "igor@wiedler.ch", 157 | "homepage": "http://wiedler.ch/igor/" 158 | } 159 | ], 160 | "description": "Événement is a very simple event dispatching library for PHP 5.3", 161 | "keywords": [ 162 | "event-dispatcher" 163 | ], 164 | "time": "2012-05-30 08:01:08" 165 | }, 166 | { 167 | "name": "monolog/monolog", 168 | "version": "1.5.0", 169 | "source": { 170 | "type": "git", 171 | "url": "https://github.com/Seldaek/monolog.git", 172 | "reference": "1.5.0" 173 | }, 174 | "dist": { 175 | "type": "zip", 176 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1.5.0", 177 | "reference": "1.5.0", 178 | "shasum": "" 179 | }, 180 | "require": { 181 | "php": ">=5.3.0", 182 | "psr/log": ">=1.0,<2.0" 183 | }, 184 | "require-dev": { 185 | "doctrine/couchdb": "dev-master", 186 | "mlehner/gelf-php": "1.0.*", 187 | "raven/raven": "0.3.*" 188 | }, 189 | "suggest": { 190 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 191 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 192 | "ext-mongo": "Allow sending log messages to a MongoDB server", 193 | "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server", 194 | "raven/raven": "Allow sending log messages to a Sentry server" 195 | }, 196 | "type": "library", 197 | "extra": { 198 | "branch-alias": { 199 | "dev-master": "1.4.x-dev" 200 | } 201 | }, 202 | "autoload": { 203 | "psr-0": { 204 | "Monolog": "src/" 205 | } 206 | }, 207 | "notification-url": "https://packagist.org/downloads/", 208 | "license": [ 209 | "MIT" 210 | ], 211 | "authors": [ 212 | { 213 | "name": "Jordi Boggiano", 214 | "email": "j.boggiano@seld.be", 215 | "homepage": "http://seld.be", 216 | "role": "Developer" 217 | } 218 | ], 219 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 220 | "homepage": "http://github.com/Seldaek/monolog", 221 | "keywords": [ 222 | "log", 223 | "logging", 224 | "psr-3" 225 | ], 226 | "time": "2013-04-23 10:09:48" 227 | }, 228 | { 229 | "name": "php-ffmpeg/php-ffmpeg", 230 | "version": "0.3.0", 231 | "source": { 232 | "type": "git", 233 | "url": "https://github.com/alchemy-fr/PHP-FFmpeg.git", 234 | "reference": "0.3.0" 235 | }, 236 | "dist": { 237 | "type": "zip", 238 | "url": "https://api.github.com/repos/alchemy-fr/PHP-FFmpeg/zipball/0.3.0", 239 | "reference": "0.3.0", 240 | "shasum": "" 241 | }, 242 | "require": { 243 | "alchemy/binary-driver": "~1.5", 244 | "doctrine/cache": "~1.0", 245 | "evenement/evenement": "~1.0", 246 | "php": ">=5.3.3" 247 | }, 248 | "require-dev": { 249 | "phpunit/phpunit": "~3.7", 250 | "sami/sami": "~1.0", 251 | "silex/silex": "~1.0" 252 | }, 253 | "suggest": { 254 | "php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg" 255 | }, 256 | "type": "library", 257 | "extra": { 258 | "branch-alias": { 259 | "dev-master": "0.3-dev" 260 | } 261 | }, 262 | "autoload": { 263 | "psr-0": { 264 | "FFMpeg": "src" 265 | } 266 | }, 267 | "notification-url": "https://packagist.org/downloads/", 268 | "license": [ 269 | "MIT" 270 | ], 271 | "authors": [ 272 | { 273 | "name": "Romain Neutron", 274 | "email": "imprec@gmail.com", 275 | "homepage": "http://www.lickmychip.com/" 276 | }, 277 | { 278 | "name": "Phraseanet Team", 279 | "email": "info@alchemy.fr", 280 | "homepage": "http://www.phraseanet.com/" 281 | } 282 | ], 283 | "description": "FFMpeg PHP, an Object Oriented library to communicate with AVconv / ffmpeg", 284 | "keywords": [ 285 | "audio", 286 | "audio processing", 287 | "avconv", 288 | "avprobe", 289 | "ffmpeg", 290 | "ffprobe", 291 | "video", 292 | "video processing" 293 | ], 294 | "time": "2013-07-03 18:53:12" 295 | }, 296 | { 297 | "name": "psr/log", 298 | "version": "1.0.0", 299 | "source": { 300 | "type": "git", 301 | "url": "https://github.com/php-fig/log", 302 | "reference": "1.0.0" 303 | }, 304 | "dist": { 305 | "type": "zip", 306 | "url": "https://github.com/php-fig/log/archive/1.0.0.zip", 307 | "reference": "1.0.0", 308 | "shasum": "" 309 | }, 310 | "type": "library", 311 | "autoload": { 312 | "psr-0": { 313 | "Psr\\Log\\": "" 314 | } 315 | }, 316 | "notification-url": "https://packagist.org/downloads/", 317 | "license": [ 318 | "MIT" 319 | ], 320 | "authors": [ 321 | { 322 | "name": "PHP-FIG", 323 | "homepage": "http://www.php-fig.org/" 324 | } 325 | ], 326 | "description": "Common interface for logging libraries", 327 | "keywords": [ 328 | "log", 329 | "psr", 330 | "psr-3" 331 | ], 332 | "time": "2012-12-21 11:40:51" 333 | }, 334 | { 335 | "name": "symfony/process", 336 | "version": "v2.3.1", 337 | "target-dir": "Symfony/Component/Process", 338 | "source": { 339 | "type": "git", 340 | "url": "https://github.com/symfony/Process.git", 341 | "reference": "v2.3.1" 342 | }, 343 | "dist": { 344 | "type": "zip", 345 | "url": "https://api.github.com/repos/symfony/Process/zipball/v2.3.1", 346 | "reference": "v2.3.1", 347 | "shasum": "" 348 | }, 349 | "require": { 350 | "php": ">=5.3.3" 351 | }, 352 | "type": "library", 353 | "extra": { 354 | "branch-alias": { 355 | "dev-master": "2.3-dev" 356 | } 357 | }, 358 | "autoload": { 359 | "psr-0": { 360 | "Symfony\\Component\\Process\\": "" 361 | } 362 | }, 363 | "notification-url": "https://packagist.org/downloads/", 364 | "license": [ 365 | "MIT" 366 | ], 367 | "authors": [ 368 | { 369 | "name": "Fabien Potencier", 370 | "email": "fabien@symfony.com" 371 | }, 372 | { 373 | "name": "Symfony Community", 374 | "homepage": "http://symfony.com/contributors" 375 | } 376 | ], 377 | "description": "Symfony Process Component", 378 | "homepage": "http://symfony.com", 379 | "time": "2013-05-06 20:03:44" 380 | } 381 | ], 382 | "packages-dev": [ 383 | { 384 | "name": "nikic/php-parser", 385 | "version": "v0.9.3", 386 | "source": { 387 | "type": "git", 388 | "url": "https://github.com/nikic/PHP-Parser", 389 | "reference": "v0.9.3" 390 | }, 391 | "dist": { 392 | "type": "zip", 393 | "url": "https://github.com/nikic/PHP-Parser/archive/v0.9.3.zip", 394 | "reference": "v0.9.3", 395 | "shasum": "" 396 | }, 397 | "require": { 398 | "php": ">=5.2" 399 | }, 400 | "type": "library", 401 | "autoload": { 402 | "psr-0": { 403 | "PHPParser": "lib/" 404 | } 405 | }, 406 | "notification-url": "https://packagist.org/downloads/", 407 | "license": [ 408 | "BSD-3-Clause" 409 | ], 410 | "authors": [ 411 | { 412 | "name": "Nikita Popov" 413 | } 414 | ], 415 | "description": "A PHP parser written in PHP", 416 | "keywords": [ 417 | "parser", 418 | "php" 419 | ], 420 | "time": "2012-11-22 18:54:05" 421 | }, 422 | { 423 | "name": "phpunit/php-code-coverage", 424 | "version": "1.2.11", 425 | "source": { 426 | "type": "git", 427 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 428 | "reference": "1.2.11" 429 | }, 430 | "dist": { 431 | "type": "zip", 432 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.11", 433 | "reference": "1.2.11", 434 | "shasum": "" 435 | }, 436 | "require": { 437 | "php": ">=5.3.3", 438 | "phpunit/php-file-iterator": ">=1.3.0@stable", 439 | "phpunit/php-text-template": ">=1.1.1@stable", 440 | "phpunit/php-token-stream": ">=1.1.3@stable" 441 | }, 442 | "require-dev": { 443 | "phpunit/phpunit": "3.7.*" 444 | }, 445 | "suggest": { 446 | "ext-dom": "*", 447 | "ext-xdebug": ">=2.0.5" 448 | }, 449 | "type": "library", 450 | "autoload": { 451 | "classmap": [ 452 | "PHP/" 453 | ] 454 | }, 455 | "notification-url": "https://packagist.org/downloads/", 456 | "include-path": [ 457 | "" 458 | ], 459 | "license": [ 460 | "BSD-3-Clause" 461 | ], 462 | "authors": [ 463 | { 464 | "name": "Sebastian Bergmann", 465 | "email": "sb@sebastian-bergmann.de", 466 | "role": "lead" 467 | } 468 | ], 469 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 470 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 471 | "keywords": [ 472 | "coverage", 473 | "testing", 474 | "xunit" 475 | ], 476 | "time": "2013-05-23 18:23:24" 477 | }, 478 | { 479 | "name": "phpunit/php-file-iterator", 480 | "version": "1.3.3", 481 | "source": { 482 | "type": "git", 483 | "url": "git://github.com/sebastianbergmann/php-file-iterator.git", 484 | "reference": "1.3.3" 485 | }, 486 | "dist": { 487 | "type": "zip", 488 | "url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3", 489 | "reference": "1.3.3", 490 | "shasum": "" 491 | }, 492 | "require": { 493 | "php": ">=5.3.3" 494 | }, 495 | "type": "library", 496 | "autoload": { 497 | "classmap": [ 498 | "File/" 499 | ] 500 | }, 501 | "notification-url": "https://packagist.org/downloads/", 502 | "include-path": [ 503 | "" 504 | ], 505 | "license": [ 506 | "BSD-3-Clause" 507 | ], 508 | "authors": [ 509 | { 510 | "name": "Sebastian Bergmann", 511 | "email": "sb@sebastian-bergmann.de", 512 | "role": "lead" 513 | } 514 | ], 515 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 516 | "homepage": "http://www.phpunit.de/", 517 | "keywords": [ 518 | "filesystem", 519 | "iterator" 520 | ], 521 | "time": "2012-10-11 04:44:38" 522 | }, 523 | { 524 | "name": "phpunit/php-text-template", 525 | "version": "1.1.4", 526 | "source": { 527 | "type": "git", 528 | "url": "git://github.com/sebastianbergmann/php-text-template.git", 529 | "reference": "1.1.4" 530 | }, 531 | "dist": { 532 | "type": "zip", 533 | "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4", 534 | "reference": "1.1.4", 535 | "shasum": "" 536 | }, 537 | "require": { 538 | "php": ">=5.3.3" 539 | }, 540 | "type": "library", 541 | "autoload": { 542 | "classmap": [ 543 | "Text/" 544 | ] 545 | }, 546 | "notification-url": "https://packagist.org/downloads/", 547 | "include-path": [ 548 | "" 549 | ], 550 | "license": [ 551 | "BSD-3-Clause" 552 | ], 553 | "authors": [ 554 | { 555 | "name": "Sebastian Bergmann", 556 | "email": "sb@sebastian-bergmann.de", 557 | "role": "lead" 558 | } 559 | ], 560 | "description": "Simple template engine.", 561 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 562 | "keywords": [ 563 | "template" 564 | ], 565 | "time": "2012-10-31 11:15:28" 566 | }, 567 | { 568 | "name": "phpunit/php-timer", 569 | "version": "1.0.4", 570 | "source": { 571 | "type": "git", 572 | "url": "git://github.com/sebastianbergmann/php-timer.git", 573 | "reference": "1.0.4" 574 | }, 575 | "dist": { 576 | "type": "zip", 577 | "url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4", 578 | "reference": "1.0.4", 579 | "shasum": "" 580 | }, 581 | "require": { 582 | "php": ">=5.3.3" 583 | }, 584 | "type": "library", 585 | "autoload": { 586 | "classmap": [ 587 | "PHP/" 588 | ] 589 | }, 590 | "notification-url": "https://packagist.org/downloads/", 591 | "include-path": [ 592 | "" 593 | ], 594 | "license": [ 595 | "BSD-3-Clause" 596 | ], 597 | "authors": [ 598 | { 599 | "name": "Sebastian Bergmann", 600 | "email": "sb@sebastian-bergmann.de", 601 | "role": "lead" 602 | } 603 | ], 604 | "description": "Utility class for timing", 605 | "homepage": "http://www.phpunit.de/", 606 | "keywords": [ 607 | "timer" 608 | ], 609 | "time": "2012-10-11 04:45:58" 610 | }, 611 | { 612 | "name": "phpunit/php-token-stream", 613 | "version": "1.1.5", 614 | "source": { 615 | "type": "git", 616 | "url": "git://github.com/sebastianbergmann/php-token-stream.git", 617 | "reference": "1.1.5" 618 | }, 619 | "dist": { 620 | "type": "zip", 621 | "url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5", 622 | "reference": "1.1.5", 623 | "shasum": "" 624 | }, 625 | "require": { 626 | "ext-tokenizer": "*", 627 | "php": ">=5.3.3" 628 | }, 629 | "type": "library", 630 | "autoload": { 631 | "classmap": [ 632 | "PHP/" 633 | ] 634 | }, 635 | "notification-url": "https://packagist.org/downloads/", 636 | "include-path": [ 637 | "" 638 | ], 639 | "license": [ 640 | "BSD-3-Clause" 641 | ], 642 | "authors": [ 643 | { 644 | "name": "Sebastian Bergmann", 645 | "email": "sb@sebastian-bergmann.de", 646 | "role": "lead" 647 | } 648 | ], 649 | "description": "Wrapper around PHP's tokenizer extension.", 650 | "homepage": "http://www.phpunit.de/", 651 | "keywords": [ 652 | "tokenizer" 653 | ], 654 | "time": "2012-10-11 04:47:14" 655 | }, 656 | { 657 | "name": "phpunit/phpunit", 658 | "version": "3.7.21", 659 | "source": { 660 | "type": "git", 661 | "url": "https://github.com/sebastianbergmann/phpunit.git", 662 | "reference": "3.7.21" 663 | }, 664 | "dist": { 665 | "type": "zip", 666 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.21", 667 | "reference": "3.7.21", 668 | "shasum": "" 669 | }, 670 | "require": { 671 | "ext-dom": "*", 672 | "ext-pcre": "*", 673 | "ext-reflection": "*", 674 | "ext-spl": "*", 675 | "php": ">=5.3.3", 676 | "phpunit/php-code-coverage": ">=1.2.1,<1.3.0", 677 | "phpunit/php-file-iterator": ">=1.3.1", 678 | "phpunit/php-text-template": ">=1.1.1", 679 | "phpunit/php-timer": ">=1.0.2,<1.1.0", 680 | "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", 681 | "symfony/yaml": ">=2.0,<3.0" 682 | }, 683 | "require-dev": { 684 | "pear-pear/pear": "1.9.4" 685 | }, 686 | "suggest": { 687 | "ext-json": "*", 688 | "ext-simplexml": "*", 689 | "ext-tokenizer": "*", 690 | "phpunit/php-invoker": ">=1.1.0,<1.2.0" 691 | }, 692 | "bin": [ 693 | "composer/bin/phpunit" 694 | ], 695 | "type": "library", 696 | "extra": { 697 | "branch-alias": { 698 | "dev-master": "3.7.x-dev" 699 | } 700 | }, 701 | "autoload": { 702 | "classmap": [ 703 | "PHPUnit/" 704 | ] 705 | }, 706 | "notification-url": "https://packagist.org/downloads/", 707 | "include-path": [ 708 | "", 709 | "../../symfony/yaml/" 710 | ], 711 | "license": [ 712 | "BSD-3-Clause" 713 | ], 714 | "authors": [ 715 | { 716 | "name": "Sebastian Bergmann", 717 | "email": "sebastian@phpunit.de", 718 | "role": "lead" 719 | } 720 | ], 721 | "description": "The PHP Unit Testing framework.", 722 | "homepage": "http://www.phpunit.de/", 723 | "keywords": [ 724 | "phpunit", 725 | "testing", 726 | "xunit" 727 | ], 728 | "time": "2013-05-23 18:54:29" 729 | }, 730 | { 731 | "name": "phpunit/phpunit-mock-objects", 732 | "version": "1.2.3", 733 | "source": { 734 | "type": "git", 735 | "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git", 736 | "reference": "1.2.3" 737 | }, 738 | "dist": { 739 | "type": "zip", 740 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip", 741 | "reference": "1.2.3", 742 | "shasum": "" 743 | }, 744 | "require": { 745 | "php": ">=5.3.3", 746 | "phpunit/php-text-template": ">=1.1.1@stable" 747 | }, 748 | "suggest": { 749 | "ext-soap": "*" 750 | }, 751 | "type": "library", 752 | "autoload": { 753 | "classmap": [ 754 | "PHPUnit/" 755 | ] 756 | }, 757 | "notification-url": "https://packagist.org/downloads/", 758 | "include-path": [ 759 | "" 760 | ], 761 | "license": [ 762 | "BSD-3-Clause" 763 | ], 764 | "authors": [ 765 | { 766 | "name": "Sebastian Bergmann", 767 | "email": "sb@sebastian-bergmann.de", 768 | "role": "lead" 769 | } 770 | ], 771 | "description": "Mock Object library for PHPUnit", 772 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 773 | "keywords": [ 774 | "mock", 775 | "xunit" 776 | ], 777 | "time": "2013-01-13 10:24:48" 778 | }, 779 | { 780 | "name": "pimple/pimple", 781 | "version": "v1.0.2", 782 | "source": { 783 | "type": "git", 784 | "url": "https://github.com/fabpot/Pimple.git", 785 | "reference": "v1.0.2" 786 | }, 787 | "dist": { 788 | "type": "zip", 789 | "url": "https://api.github.com/repos/fabpot/Pimple/zipball/v1.0.2", 790 | "reference": "v1.0.2", 791 | "shasum": "" 792 | }, 793 | "require": { 794 | "php": ">=5.3.0" 795 | }, 796 | "type": "library", 797 | "extra": { 798 | "branch-alias": { 799 | "dev-master": "1.0.x-dev" 800 | } 801 | }, 802 | "autoload": { 803 | "psr-0": { 804 | "Pimple": "lib/" 805 | } 806 | }, 807 | "notification-url": "https://packagist.org/downloads/", 808 | "license": [ 809 | "MIT" 810 | ], 811 | "authors": [ 812 | { 813 | "name": "Fabien Potencier", 814 | "email": "fabien@symfony.com" 815 | } 816 | ], 817 | "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", 818 | "homepage": "http://pimple.sensiolabs.org", 819 | "keywords": [ 820 | "container", 821 | "dependency injection" 822 | ], 823 | "time": "2013-03-08 08:21:40" 824 | }, 825 | { 826 | "name": "sami/sami", 827 | "version": "v1.0", 828 | "source": { 829 | "type": "git", 830 | "url": "https://github.com/fabpot/Sami.git", 831 | "reference": "v1.0" 832 | }, 833 | "dist": { 834 | "type": "zip", 835 | "url": "https://api.github.com/repos/fabpot/Sami/zipball/v1.0", 836 | "reference": "v1.0", 837 | "shasum": "" 838 | }, 839 | "require": { 840 | "nikic/php-parser": "0.9.*", 841 | "php": ">=5.3.0", 842 | "pimple/pimple": "1.0.*", 843 | "symfony/console": ">=2.1,<3.0", 844 | "symfony/filesystem": ">=2.1,<3.0", 845 | "symfony/finder": ">=2.1,<3.0", 846 | "symfony/process": ">=2.1,<3.0", 847 | "symfony/yaml": ">=2.1,<3.0", 848 | "twig/twig": "1.*" 849 | }, 850 | "bin": [ 851 | "sami.php" 852 | ], 853 | "type": "application", 854 | "extra": { 855 | "branch-alias": { 856 | "dev-master": "1.0-dev" 857 | } 858 | }, 859 | "autoload": { 860 | "psr-0": { 861 | "Sami": "." 862 | } 863 | }, 864 | "notification-url": "https://packagist.org/downloads/", 865 | "license": [ 866 | "MIT" 867 | ], 868 | "authors": [ 869 | { 870 | "name": "Fabien Potencier", 871 | "email": "fabien@symfony.com" 872 | } 873 | ], 874 | "description": "Sami, an API documentation generator", 875 | "homepage": "http://sami.sensiolabs.org", 876 | "keywords": [ 877 | "phpdoc" 878 | ], 879 | "time": "2013-04-05 13:01:32" 880 | }, 881 | { 882 | "name": "symfony/console", 883 | "version": "v2.3.1", 884 | "target-dir": "Symfony/Component/Console", 885 | "source": { 886 | "type": "git", 887 | "url": "https://github.com/symfony/Console.git", 888 | "reference": "v2.3.1" 889 | }, 890 | "dist": { 891 | "type": "zip", 892 | "url": "https://api.github.com/repos/symfony/Console/zipball/v2.3.1", 893 | "reference": "v2.3.1", 894 | "shasum": "" 895 | }, 896 | "require": { 897 | "php": ">=5.3.3" 898 | }, 899 | "require-dev": { 900 | "symfony/event-dispatcher": ">=2.1,<3.0" 901 | }, 902 | "suggest": { 903 | "symfony/event-dispatcher": "" 904 | }, 905 | "type": "library", 906 | "extra": { 907 | "branch-alias": { 908 | "dev-master": "2.3-dev" 909 | } 910 | }, 911 | "autoload": { 912 | "psr-0": { 913 | "Symfony\\Component\\Console\\": "" 914 | } 915 | }, 916 | "notification-url": "https://packagist.org/downloads/", 917 | "license": [ 918 | "MIT" 919 | ], 920 | "authors": [ 921 | { 922 | "name": "Fabien Potencier", 923 | "email": "fabien@symfony.com" 924 | }, 925 | { 926 | "name": "Symfony Community", 927 | "homepage": "http://symfony.com/contributors" 928 | } 929 | ], 930 | "description": "Symfony Console Component", 931 | "homepage": "http://symfony.com", 932 | "time": "2013-06-11 07:15:14" 933 | }, 934 | { 935 | "name": "symfony/filesystem", 936 | "version": "v2.3.1", 937 | "target-dir": "Symfony/Component/Filesystem", 938 | "source": { 939 | "type": "git", 940 | "url": "https://github.com/symfony/Filesystem.git", 941 | "reference": "v2.3.1" 942 | }, 943 | "dist": { 944 | "type": "zip", 945 | "url": "https://api.github.com/repos/symfony/Filesystem/zipball/v2.3.1", 946 | "reference": "v2.3.1", 947 | "shasum": "" 948 | }, 949 | "require": { 950 | "php": ">=5.3.3" 951 | }, 952 | "type": "library", 953 | "extra": { 954 | "branch-alias": { 955 | "dev-master": "2.3-dev" 956 | } 957 | }, 958 | "autoload": { 959 | "psr-0": { 960 | "Symfony\\Component\\Filesystem\\": "" 961 | } 962 | }, 963 | "notification-url": "https://packagist.org/downloads/", 964 | "license": [ 965 | "MIT" 966 | ], 967 | "authors": [ 968 | { 969 | "name": "Fabien Potencier", 970 | "email": "fabien@symfony.com" 971 | }, 972 | { 973 | "name": "Symfony Community", 974 | "homepage": "http://symfony.com/contributors" 975 | } 976 | ], 977 | "description": "Symfony Filesystem Component", 978 | "homepage": "http://symfony.com", 979 | "time": "2013-06-04 15:02:05" 980 | }, 981 | { 982 | "name": "symfony/finder", 983 | "version": "v2.3.1", 984 | "target-dir": "Symfony/Component/Finder", 985 | "source": { 986 | "type": "git", 987 | "url": "https://github.com/symfony/Finder.git", 988 | "reference": "v2.3.1" 989 | }, 990 | "dist": { 991 | "type": "zip", 992 | "url": "https://api.github.com/repos/symfony/Finder/zipball/v2.3.1", 993 | "reference": "v2.3.1", 994 | "shasum": "" 995 | }, 996 | "require": { 997 | "php": ">=5.3.3" 998 | }, 999 | "type": "library", 1000 | "extra": { 1001 | "branch-alias": { 1002 | "dev-master": "2.3-dev" 1003 | } 1004 | }, 1005 | "autoload": { 1006 | "psr-0": { 1007 | "Symfony\\Component\\Finder\\": "" 1008 | } 1009 | }, 1010 | "notification-url": "https://packagist.org/downloads/", 1011 | "license": [ 1012 | "MIT" 1013 | ], 1014 | "authors": [ 1015 | { 1016 | "name": "Fabien Potencier", 1017 | "email": "fabien@symfony.com" 1018 | }, 1019 | { 1020 | "name": "Symfony Community", 1021 | "homepage": "http://symfony.com/contributors" 1022 | } 1023 | ], 1024 | "description": "Symfony Finder Component", 1025 | "homepage": "http://symfony.com", 1026 | "time": "2013-06-02 12:05:51" 1027 | }, 1028 | { 1029 | "name": "symfony/yaml", 1030 | "version": "v2.3.1", 1031 | "target-dir": "Symfony/Component/Yaml", 1032 | "source": { 1033 | "type": "git", 1034 | "url": "https://github.com/symfony/Yaml.git", 1035 | "reference": "v2.3.1" 1036 | }, 1037 | "dist": { 1038 | "type": "zip", 1039 | "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.3.1", 1040 | "reference": "v2.3.1", 1041 | "shasum": "" 1042 | }, 1043 | "require": { 1044 | "php": ">=5.3.3" 1045 | }, 1046 | "type": "library", 1047 | "extra": { 1048 | "branch-alias": { 1049 | "dev-master": "2.3-dev" 1050 | } 1051 | }, 1052 | "autoload": { 1053 | "psr-0": { 1054 | "Symfony\\Component\\Yaml\\": "" 1055 | } 1056 | }, 1057 | "notification-url": "https://packagist.org/downloads/", 1058 | "license": [ 1059 | "MIT" 1060 | ], 1061 | "authors": [ 1062 | { 1063 | "name": "Fabien Potencier", 1064 | "email": "fabien@symfony.com" 1065 | }, 1066 | { 1067 | "name": "Symfony Community", 1068 | "homepage": "http://symfony.com/contributors" 1069 | } 1070 | ], 1071 | "description": "Symfony Yaml Component", 1072 | "homepage": "http://symfony.com", 1073 | "time": "2013-05-10 18:12:13" 1074 | }, 1075 | { 1076 | "name": "twig/twig", 1077 | "version": "v1.13.1", 1078 | "source": { 1079 | "type": "git", 1080 | "url": "https://github.com/fabpot/Twig.git", 1081 | "reference": "v1.13.1" 1082 | }, 1083 | "dist": { 1084 | "type": "zip", 1085 | "url": "https://api.github.com/repos/fabpot/Twig/zipball/v1.13.1", 1086 | "reference": "v1.13.1", 1087 | "shasum": "" 1088 | }, 1089 | "require": { 1090 | "php": ">=5.2.4" 1091 | }, 1092 | "type": "library", 1093 | "extra": { 1094 | "branch-alias": { 1095 | "dev-master": "1.13-dev" 1096 | } 1097 | }, 1098 | "autoload": { 1099 | "psr-0": { 1100 | "Twig_": "lib/" 1101 | } 1102 | }, 1103 | "notification-url": "https://packagist.org/downloads/", 1104 | "license": [ 1105 | "BSD-3" 1106 | ], 1107 | "authors": [ 1108 | { 1109 | "name": "Fabien Potencier", 1110 | "email": "fabien@symfony.com" 1111 | }, 1112 | { 1113 | "name": "Armin Ronacher", 1114 | "email": "armin.ronacher@active-4.com" 1115 | } 1116 | ], 1117 | "description": "Twig, the flexible, fast, and secure template language for PHP", 1118 | "homepage": "http://twig.sensiolabs.org", 1119 | "keywords": [ 1120 | "templating" 1121 | ], 1122 | "time": "2013-06-06 06:06:01" 1123 | } 1124 | ], 1125 | "aliases": [ 1126 | 1127 | ], 1128 | "minimum-stability": "stable", 1129 | "stability-flags": [ 1130 | 1131 | ], 1132 | "platform": { 1133 | "php": ">=5.3.2" 1134 | }, 1135 | "platform-dev": [ 1136 | 1137 | ] 1138 | } 1139 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | tests 26 | 27 | 28 | 29 | 30 | vendor 31 | tests 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/FFMpeg/Format/Video/ThreeGP.php: -------------------------------------------------------------------------------- 1 | videoCodec; 61 | } 62 | 63 | public function getAudioCodec() 64 | { 65 | return $this->audioCodec; 66 | } 67 | 68 | public function getAvailableVideoCodecs() 69 | { 70 | return array('h263', 'libx264'); 71 | } 72 | 73 | public function getAvailableAudioCodecs() 74 | { 75 | return array('aac', 'amr'); 76 | } 77 | 78 | public function supportBFrames() 79 | { 80 | return false; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /tests/output/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHP-FFMpeg/PHP-FFMpeg-Extras/95f90f97f0baf4c2527d478103d1cc6fdc73721f/tests/output/.gitkeep -------------------------------------------------------------------------------- /tests/ressources/test.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PHP-FFMpeg/PHP-FFMpeg-Extras/95f90f97f0baf4c2527d478103d1cc6fdc73721f/tests/ressources/test.mp4 -------------------------------------------------------------------------------- /tests/src/FFMpeg/Encode/ThreeGP/ThreeGPTest.php: -------------------------------------------------------------------------------- 1 | ffmpeg = FFMpeg::create(); 24 | $this->input = __DIR__ . '/../../../../ressources/test.mp4'; 25 | $this->output = __DIR__ . '/../../../../output/test.3gp'; 26 | } 27 | 28 | protected function tearDown() 29 | { 30 | if (is_file($this->output)) { 31 | $this->assertGreaterThan(0, filesize($this->output)); 32 | unlink($this->output); 33 | } 34 | } 35 | 36 | public function testEncodeBasic() 37 | { 38 | try { 39 | $video = $this->ffmpeg->open($this->input); 40 | $video->filters()->resize(new Dimension(128, 96)); 41 | $video->save(new ThreeGP(), $this->output); 42 | } catch (\FFMpeg\Exception\Exception $e) { 43 | $this->fail($e->getMessage()); 44 | } 45 | } 46 | 47 | public function testEncodeOtherCodec() 48 | { 49 | $format = new ThreeGP(); 50 | 51 | $format->setVideoCodec('libx264'); 52 | $format->setAudioCodec('amr'); 53 | 54 | try { 55 | $this->ffmpeg 56 | ->open($this->input) 57 | ->save($format, $this->output); 58 | } catch (\FFMpeg\Exception\Exception $e) { 59 | $this->fail($e->getMessage()); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /tests/src/FFMpeg/Format/Video/ThreeGPTest.php: -------------------------------------------------------------------------------- 1 | format = new ThreeGP(); 17 | } 18 | 19 | /** 20 | * @covers FFMpeg\Format\Video\ThreeGP::getExtraParams 21 | */ 22 | public function testGetExtraParams() 23 | { 24 | $this->assertEquals(array('-f', '3gp'), $this->format->getExtraParams()); 25 | } 26 | 27 | /** 28 | * @covers FFMpeg\Format\Video\ThreeGP::getVideoCodec 29 | */ 30 | public function testGetVideoCodec() 31 | { 32 | $this->assertEquals('h263', $this->format->getVideoCodec()); 33 | } 34 | 35 | /** 36 | * @covers FFMpeg\Format\Video\ThreeGP::getAudioCodec 37 | */ 38 | public function testGetAudioCodec() 39 | { 40 | $this->assertEquals('aac', $this->format->getAudioCodec()); 41 | } 42 | 43 | /** 44 | * @covers FFMpeg\Format\Video\ThreeGP::getAvailableVideoCodecs 45 | */ 46 | public function testGetAvailableVideoCodecs() 47 | { 48 | $codecs = $this->format->getAvailableVideoCodecs(); 49 | 50 | $this->assertTrue(is_array($codecs)); 51 | 52 | $this->assertContains('h263', $codecs); 53 | $this->assertContains('libx264', $codecs); 54 | } 55 | 56 | /** 57 | * @covers FFMpeg\Format\Video\ThreeGP::getAvailableAudioCodecs 58 | */ 59 | public function testGetAvailableAudioCodecs() 60 | { 61 | $codecs = $this->format->getAvailableAudioCodecs(); 62 | 63 | $this->assertTrue(is_array($codecs)); 64 | 65 | $this->assertContains('aac', $codecs); 66 | $this->assertContains('amr', $codecs); 67 | } 68 | 69 | /** 70 | * @covers FFMpeg\Format\Video\ThreeGP::setVideoCodec 71 | */ 72 | public function testSetVideoCodec() 73 | { 74 | $this->format->setVideoCodec('libx264'); 75 | 76 | $this->assertEquals('libx264', $this->format->getVideoCodec()); 77 | } 78 | 79 | /** 80 | * @covers FFMpeg\Format\Video\ThreeGP::setAudioCodec 81 | */ 82 | public function testSetAudioCodec() 83 | { 84 | $this->format->setAudioCodec('amr'); 85 | 86 | $this->assertEquals('amr', $this->format->getAudioCodec()); 87 | } 88 | 89 | /** 90 | * @covers FFMpeg\Format\Video\ThreeGP::setVideoCodec 91 | * @expectedException \FFMpeg\Exception\InvalidArgumentException 92 | */ 93 | public function testSetVideoCodecException() 94 | { 95 | $this->format->setVideoCodec('unknow'); 96 | } 97 | 98 | /** 99 | * @covers FFMpeg\Format\Video\ThreeGP::setAudioCodec 100 | * @expectedException \FFMpeg\Exception\InvalidArgumentException 101 | */ 102 | public function testSetAudioCodecException() 103 | { 104 | $this->format->setAudioCodec('unknow'); 105 | } 106 | 107 | /** 108 | * @covers FFMpeg\Format\Video\ThreeGP::supportBFrames 109 | */ 110 | public function testSupportBFrames() 111 | { 112 | $this->assertFalse($this->format->supportBFrames()); 113 | } 114 | } 115 | --------------------------------------------------------------------------------