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:
		
					parent
					
						
							
								93b0c348cf
							
						
					
				
			
			
				commit
				
					
						460a035697
					
				
			
		
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -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 | ||||
| ``` | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue