Fixed sample for duration and added sample for codec_name

I've updated the README file, because the existing example for getting the duration of a file was not working for file-types like WebM (see #103).

To not to loose the sample that was already in place, I changed it to return the codec-name for the video. Maybe returning width or height of a video is more used, but we can't have a sample for all ;)
This commit is contained in:
Simon Schick 2014-06-03 09:47:27 +02:00
commit 521c708290

View file

@ -364,6 +364,13 @@ $ffprobe
->streams('/path/to/video/mp4') // extracts streams informations
->videos() // filters video streams
->first() // returns the first video stream
->get('codec_name'); // returns the codec_name property
```
```php
$ffprobe = FFMpeg\FFProbe::create();
$ffprobe
->format('/path/to/video/mp4') // extracts file informations
->get('duration'); // returns the duration property
```