As far as I can tell from the ffmpeg docs, they don’t provide a way to use timestamps in the filename rather than sequential numbers. What they provide allows you to create 0001.jpg, 0002.jpg, 0003.jpg but not 2011-08-01 7:30:00.jpg, 2011-08-01 7:30:01.jpg, 2011-08-01 7:30:02.jpg. Can anyone think of a solution that could take the sequentially named files from ffmpeg and name them using their created time?
Share
On unixoid systems, you can use find + ImageMagick to identify each file and its creation date-time. ImageMagick normally has to be installed:
gnu:find is available for Windows too, but not normally distributed by Microsoft. Instead, Microsoft has its own, inferior (afaik) kind of find(.exe), with very different syntax.
So if you install gnu-find, it has to be called with the whole path, or renamed to gfind for example, to prevent name collision.
I would write a small script
which is vulnerable to filenames, including blanks, but if your files are always named 0001.jpg and so on, it will be no problem.
The script would produce
2011-08-03T12:39:42+02:00for example as a filename, and could be called by find:If you don’t use/have a bash, you need to modify it accordingly.
Warning:
You have to be careful. If the time of 2 or more files is identical, they will be silently overriden. Of course you may build a check into your script, and maybe your filesystem can store the date more precise than in seconds-interval.