# Fix time of photos intervals

**URL:** <https://forum.mapillary.com/t/fix-time-of-photos-intervals/4187>\
**Category:** Command line tools\
**Created:** [June 23, 2020, 8:39am UTC](https://forum.mapillary.com/t/fix-time-of-photos-intervals/4187 "2020-06-23T08:39:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbang001](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bigbang001](https://forum.mapillary.com/u/bigbang001)\
**Post date:** [June 23, 2020, 8:39am UTC](https://forum.mapillary.com/t/fix-time-of-photos-intervals/4187/1 "2020-06-23T08:39:45Z")

</div>

Hi,  
Recently I bought Gopro Hero 8.  
Unfortunately when I set time lapse photo interval to 0.5sec, sometimes the time of photo is not accurate (about 1 minute) but the position of the photos are correct, that cause photos in mapillary are in their correct place but wrong sort in sequence.  
I tried use\_gps\_time somotetimes this fix times issues but in some photos still there is 0.5sec gap.  
Is there any command or way to load the 1st image exact time and add 0.5 sec interval to next images? (photos are sorted by their name).

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [June 23, 2020, 4:02pm UTC](https://forum.mapillary.com/t/fix-time-of-photos-intervals/4187/2 "2020-06-23T16:02:26Z")

</div>

I have certainly done it by “touching” each image with a sequential time offset, then writing that back into the EXIF for later processing. It’s a Linux based script. I’d have to dig it out so please get back to me if you can use it

---

<div class="post-metadata">

**Author:** ![bigbang001](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bigbang001](https://forum.mapillary.com/u/bigbang001)\
**Post date:** [June 23, 2020, 4:50pm UTC](https://forum.mapillary.com/t/fix-time-of-photos-intervals/4187/3 "2020-06-23T16:50:47Z")

</div>

Thank you @bob3bob3  
Unfortunately I have only macOS and windows.  
☹

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [June 23, 2020, 10:28pm UTC](https://forum.mapillary.com/t/fix-time-of-photos-intervals/4187/4 "2020-06-23T22:28:53Z")

</div>

macOS I believe is basically a Unix CLI. (So if you wish to try)

My horrible code is below. You would have to adapt it. “STAMP” will be the first image date/time and the filename pattern would need altering.

Basically it makes the file modify date/time increase by 0.5 secs per image. “jhead” is a utility that writes EXIF data.

touch -d “$STAMP” $1\_000001.jpg

PRIOR=$1\_000001.jpg  
for F2C in `ls -1 *.jpg|tac|head -n -1|tac` ; do  
touch -r “$PRIOR” -d ‘+0.5 sec’ “$F2C”  
PRIOR=$F2C  
done

TZ=utc jhead -mkexif -dsft \*.jpg
