Importing GPS coords from 360°.mp4 to rendered frames in 360° .png

Started by david.matousu, February 18, 2021, 08:43:18 AM

Previous topic - Next topic

david.matousu

Hello everyone, there is my problem:
I have source 360° .mp4 file (captured with Insta360 Pro, with GPS metadata), which I need to edit in After Effects - some retouching etc. and then export it as .png sequence. But after export, I lost this metadata...
Is there some possibility how to embed gps coords to the relevant .png frames?

I exported the data using exiftools
exiftool -ee -p gpx.fmt F:\source.mp4 > source.gpx

Can I write this somehow in bulk to the png frames? Or I have to do it manualy to each frame?

This is only test sequence, about 30 seconds long. But the final video will be about 1 hour long, so I would appreciate some "automatic" procedure

Thank you very much :)

StarGeek

If you could figure out how to get the correct timestamp for each of the frames, then it would simply be geotagging the images.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

david.matousu

Hi thanks.
Do you have any idea how to do this? I've tried some things from the link you sent, but I don't understand it very much: /

Thank you,
David

Phil Harvey

Hi David,

First, set DateTimeOriginal for all the frames to be the same as the video:

exiftool -tagsfromfile VIDEO.mp4 "-datetimeoriginal<createdate" -ext jpg DIR

Then increment the times of each video based on the time separation between the frames.  See this thread.

Then do the geotagging of the jpg files from your .gpx output:

exiftool -geotag source.gpx -ext jpg DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

david.matousu

Thanks, its working :)

I have one question: it is possible to adjust the time to less than a second? I tried something like:
"-datetimeoriginal+<0:0:0:${filesequence;$_*=1}"
or
"-datetimeoriginal+<0:0:${filesequence;$_*=0,1}"

In the gpx file is time  2021-02-12T14:21:11.7Z - can i somehow match these nanoseconds or it doesnt matter? We are going to make some sort of virtual tour from the car and we need picture every 5meters (for example)

Thanks 

StarGeek

Quote from: david.matousu on March 01, 2021, 10:00:24 AM
I have one question: it is possible to adjust the time to less than a second? I tried something like:

Part of the problem is the fact that the EXIF timestamps such as DateTimeOriginal only hold full seconds.  Subseconds are held in a different tag, SubSecTimeOriginal.  So in order to shift the time, it would have to add to the SubSecTimeOriginal and then carry over into the DateTimeOriginal.  And exiftool doesn't have that ability as far as I know.

But I think I figured out a way using the XMP timestamps.  You could try using XMP:DateTimeOriginal
"-XMP:DateTimeOriginal+<0:0:${filesequence;$_*=0.1}"
(note that you have to use a dot, not a comma to separate the decimals)

Example
C:\>exiftool -g1 -a -s -XMP:DateTimeOriginal y:\!temp\Test3.jpg  y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
---- XMP-exif ----
DateTimeOriginal                : 2021:03:01 08:48:12.99
======== y:/!temp/Test4.jpg
---- XMP-exif ----
DateTimeOriginal                : 2021:03:01 08:48:12.99
    2 image files read

C:\>exiftool -P -overwrite_original "-xmp:DateTimeOriginal+<0:0:${filesequence;$_*=0.1}" y:\!temp\Test3.jpg  y:\!temp\Test4.jpg
    1 image files updated
    1 image files unchanged

C:\>exiftool -g1 -a -s -XMP:DateTimeOriginal y:\!temp\Test3.jpg  y:\!temp\Test4.jpg
======== y:/!temp/Test3.jpg
---- XMP-exif ----
DateTimeOriginal                : 2021:03:01 08:48:12.99
======== y:/!temp/Test4.jpg
---- XMP-exif ----
DateTimeOriginal                : 2021:03:01 08:48:13.09
    2 image files read


I think you'll need to use the GeoTime tag to make sure you use the correct timestamp, but I could be wrong
"-Geotime<XMP:DateTimeOriginal#"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Quote from: StarGeek on March 01, 2021, 12:14:18 PM
So in order to shift the time, it would have to add to the SubSecTimeOriginal and then carry over into the DateTimeOriginal.  And exiftool doesn't have that ability as far as I know.

Correct.

QuoteBut I think I figured out a way using the XMP timestamps.

Smart.

QuoteI think you'll need to use the GeoTime tag to make sure you use the correct timestamp, but I could be wrong
"-Geotime<XMP:DateTimeOriginal#"

Correct.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).