ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: pkthogit on July 23, 2024, 12:31:13 AM

Title: Merging dashcam videos and adding merged GPX data to final video
Post by: pkthogit on July 23, 2024, 12:31:13 AM
Hi Team,

I have a folder with 100+ mp4 files (each 1min duration) and its corresponding gpx file extracted from GPS enabled dashcam device.

Each individual mp4 file has geotagging information for each 1 sec as shown below.

SampleTime                      : 29.00 s
SampleDuration                  : 1.00 s
GPSLatitude                     : 48 deg 54' 18.95" N
GPSLongitude                    : 2 deg 16' 48.06" E
GPSSpeed                        : 51.4989
GPSDateTime                     : 2022:05:18 09:40:39.000Z
SampleTime                      : 0:00:30
SampleDuration                  : 0 s
Text                            :
SampleTime                      : 0:00:30
SampleDuration                  : 1.00 s
GPSLatitude                     : 48 deg 54' 19.17" N
GPSLongitude                    : 2 deg 16' 48.37" E
GPSSpeed                        : 51.4989
GPSDateTime                     : 2022:05:18 09:40:40.000Z
SampleTime                      : 0:00:31
SampleDuration                  : 0 s
Text                            :


Right now I need to merge every 5 consecutive mp4 files together to have 5min video and also retain such geotagging metadata for 5 mins. I was able to generate merged mp4 file but I could not add geotagging information either from merged gpx file.

ls *.MP4 | awk '{print "file '\''" $0 "'\''"}' > filelist.txt
ffmpeg -f concat -safe 0 -i filelist.txt -c copy merged.mp4
Does this exiftool support adding geotagging GPX data to mp4 file? if yes, please point to the details

Or may be any other tool which does this job, would love to explore.

Any help would be much appreciate in this regards.

-Prem
Title: Re: Merging dashcam videos and adding merged GPX data to final video
Post by: Phil Harvey on July 23, 2024, 09:37:42 AM
ExifTool does not currently have the ability to write timed GPS to MP4 videos.

- Phil
Title: Re: Merging dashcam videos and adding merged GPX data to final video
Post by: StarGeek on July 23, 2024, 10:19:32 AM
To expand upon that, there isn't any program, not at least that I can find, that can merge a GPS track into a video.

My standard copy/paste when it comes to GPS data in a video 

The problem is that there really isn't a standard for embedding a GPS track in a video* Currently, exiftool reads 74 different ways that a GPS track can be in a video and there are about half a dozen more in which the format hasn't been decoded. I have yet to find a program that will embed a GPS track into a video file.

The best you can do is extract the GPS data into a GPX track and save it separately.

*Technically, there is a standard by Google, but nobody follows it, and I've never found any software that write this format. I mention it in this Exiftool forum's post (https://exiftool.org/forum/index.php?msg=69582%5C), which has a response from the author of exiftool

Title: Re: Merging dashcam videos and adding merged GPX data to final video
Post by: Phil Harvey on July 23, 2024, 10:55:15 AM
Quote from: StarGeek on July 23, 2024, 10:19:32 AMCurrently, exiftool reads 74 different ways that a GPS track can be in a video

I'm adding 2 new types in 12.90, so this will be 76.  :)

- Phil