Zend certified PHP/Magento developer

BASH script to copy image files recursively from camera 100MEDIA 101MEDIA etc folders and rename with creation/birth date to single folder

Spent a couple hours looking for an answer but I think I need specific help here.

My trail cam has months of timelapse .JPG photos taken 5 minutes apart resulting in 14,000+ .JPG files in 15 subdirectories of DCIM/100MEDIA, 101MEDIA, 102MEDIA…, 114MEDIA with 1000 files in each folder. The files in each folder are all named the same as the other folders:

DSCF0001.JPG, DSCF0002.JPG, DSCF0003.JPG…, DSCF0999.JPG so can’t just copy all to one place without renaming.

My task is to copy all 14,000+ files to a single folder, and rename each to its creation date.JPG (or stat command Birth: value).JPG while doing so.

stat reveals the Birth: value on these files is the actual time it was taken, in decimal seconds format, so all the names will be in in perfect order to process in one folder.

The whole purpose is to use ffmpeg to compile a timelapse video of the scene, which I’ve already successfully accomplished using this trail camera’s timelapse setting photos. But those were only 1000 frames at a time vids.

I want to watch the whole 14,000+ frame video!

(edit) Adding that totally open to any other more direct way to use a script to process these files in place with ffmpeg without making renamed copies.

My ffmpeg command that I’m using:

ffmpeg -framerate 24 -i DSCF%04d.JPG -c:v libx264 -crf 0 1_timelapse.mp4

Thanks in advance for any direction to accomplish this!