Merging dashcam videos and adding merged GPX data to final video

Started by pkthogit, July 23, 2024, 12:31:13 AM

Previous topic - Next topic

pkthogit

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

Phil Harvey

ExifTool does not currently have the ability to write timed GPS to MP4 videos.

- 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 ($).

StarGeek

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, which has a response from the author of exiftool

"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 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
...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 ($).