Pages

Sunday, June 9, 2013

Cakephp-Convert time from ffmpeg extension to required format

Recently I used ffmeg to encode videos to flv format in one of my projects.

You need to include its php extension to perform the same or you can use the software too..I will discuss the same in some lator post..

Meanwhile after encoding videos it was returning me its time in following format

"00:04:43.77"

where as client asked me to change the same to

"00:04:43" i.e, to eliminate the millisecond part..


I used

 <?php  
 $vidlen=new DateTime($myvideolength);  
 echo "converted time=";  
 $vidlen->format("H:i:s");  
 ?>  

No comments:

Post a Comment