0

I want to extract frames every 10 seconds from a video and geotag these frames using a GPX track.

On my Windows 8 computer I have tools to extract the frames (FFMPEG), set image timestamps (ExifTool) and geotag the images (GeoSetter).

However, I do not know how to copy the timestamp from the video over to the timestamp of the captured frame.

Peter
  • 113

1 Answers1

1

That batch file extract frames every X seconds and then geotags it: https://gist.github.com/Krzysiu/345c37b08d79d5f47971167e33bb2bd3

It requires ffmpeg and exiftool. All settings have to be filled out manually (lines 28-68).

How does it work internally?

  1. At first it extracts frames using ffmpeg filter with proper options (default ones won't do the trick)
  2. It sets the same timestamp to all extracted frames*. Timestamp might be manually provided timestamp or any tag/file modify&create time from video file
  3. The time shift for every image is applied. I used that method, as there seems to be no easy way to shift time in case of manual timestamp.
  4. Frames are geotagged using gpx file.

* in fact to the all files matching %output_directory%\%frame_prefix%*.jpg, so if you've extracted at first 150 frames and then 100 to the same directory and with same prefix, it will process all 150 frames, including 101-150 from earlier pass.

Possibly it can be done much faster - expression in Exiftool which would multiply file index by X from "frame every X seconds". I'm not that good with Perl expressions and Exiftool, so I made it this way.

Krzysiu
  • 285
  • 2
  • 8