Is it possible to set the -ss and -t flags in FFMPEG in frames?
I am building a simple video trimmer in PHP with FFMPEG and have been using PHP-FFMPEG to extract screen grabs etc and it works entirely in frames. Also my script requires that I add and subtract variable amounts of time to the start and end of the vid which is so much easier to do in FPS. PHP-FFMPEG tells me the fps of the vid, so I can accurately pinpoint frames as required.
Alternatively does anyone know of a nice little script for converting frames to HH:MM:SS.xx format at all? I can just use that instead. My Google attempts have been fruitless so far, and my attempt at it has got me rather stressed.
You don't need to convert to HH:MM:SS.xx format.
The -t
and -ss
flags for FFmpeg accept the number of seconds (including decimal) as well as HH:MM:SS.xx format. From the docs:
-ss position (input/output)
When used as an input option (before-i
), seeks in this input file toposition
. When used as an output option (before an output filename), decodes but discards input until the timestamps reachposition
. This is slower, but more accurate.position may be either in seconds or in hh:mm:ss[.xxx] form.
So just do frames/frames per second and you've got your input.