Tag ffmpeg

Convert time (hr:min:secs) into seconds 3

Sep14

I wrote this snippet to convert ffmpeg’s information output time into seconds, i can then determine the 25, 50 and 75 percentages to create 3 different thumbnails of a movie (using ffmpeg also).

Heres the snippet:

function time2seconds($time='00:00:00'){
  list($hr,$m,$s) = explode(':', $time);
  return ( (int)$hr*3600 ) + ( (int)$m*60 ) + (int)$s;
}

Hope you find this as useful as I have.

arkinEx Codex is powered by WordPress and FREEmium Theme.
developed by Dariusz Siedlecki and brought to you by FreebiesDock.com