AnilKumar

Joined: 09 May 2008 Posts: 197
|
Posted: Tue Jul 14, 2009 8:55 am Post subject: How to get information about the video file using ffmpeg? |
|
|
Hi ,
To tal information about the video file can be stored into one txt file using following command :
ffmpeg -i video.mpg 2> input_file.txt
This input_file.txt files having the total information of that video.mpg file.
Php code to get the duration from that file:
$handle = @fopen ('input_file.txt','r');
if ($handle) {
While (! feof ($handle)) {
$buffer. = fgets ($handle, 4096);
}
fclose ($handle);
}
$duration_pos= strpos ($buffer,'Duration');
$duration_pos1= substr ($buffer, $duration_pos,1 ;
$str=explode (" ", $duration_pos1);
using this command we can get duration of one video file.
Thank You,
Anil Kumar  |
|