I have an MP4 from a GoPro with a gpstrack included. Now I am trying to extract a geotagged image sequence from that video. For that I am currently using FFmpeg and exiftool; I'm open to better solutions.
I have never used FFmpeg nor exiftool before and am only a beginner using powershell so this is the script I prompted myself from GPT:
$skriptFolder = Split-Path $MyInvocation.MyCommand.Path
$framerate = Read-Host "Enter framerate"
foreach ($video in (Get-ChildItem -Path $skriptFolder -Filter *.mp4)) {
$videoName = $video.BaseName
$outputFolder = Join-Path $skriptFolder $videoName
if (-not (Test-Path -Path $outputFolder)) {
New-Item -ItemType Directory -Path $outputFolder | Out-Null
}
ffmpeg -i $($video.FullName) -vf fps=$framerate $outputFolder\$videoName-%04d.png
exiftool -p C:\Windows\gpx.fmt -ee3 $video.FullName -w .gpx
exiftool -tagsfromfile $video.FullName -XMP:DateTimeOriginal<CreateDate $outputFolder
exiftool -geotag "$videoName.gpx" "-Geotime=XMP:DateTimeOriginal+=0:0:${filesequence;$_*=1/$framerate}" $outputFolder\*.png
}
Read-Host "Press enter to exit"
I can successfully create the images and the GPX file. But then I get stuck with matching the gps data and the images. The problem I think is, that the DateTimeOriginal
does not get copied from the original videofile. Also I am not sure if I implemented the file sequence correctly.
This is my error message I still get:
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in File:Geotime (ValueConvInv)