From c3dd96125aa1d8601b50fd77abfbc7fb8df4c452 Mon Sep 17 00:00:00 2001 From: Stefan Breunig <307954+breunigs@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:23:08 +0200 Subject: [PATCH] add gpx extraction exiftool formatter --- data/gpx_extended.fmt | 28 ++++++++++++++++++++++++++++ lib/video/source.ex | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 data/gpx_extended.fmt diff --git a/data/gpx_extended.fmt b/data/gpx_extended.fmt new file mode 100644 index 00000000..7770e762 --- /dev/null +++ b/data/gpx_extended.fmt @@ -0,0 +1,28 @@ +# example usage: +# exiftool -extractEmbedded -ignoreMinorErrors -printFormat -binary -textOut gpx … +# +#[HEAD] +#[HEAD] +#[HEAD] +#[HEAD] $filename# +#[HEAD] $duration# sec runtime @ @ $rate# real time +#[HEAD] $model @ $firmwareversion +#[HEAD] +#[HEAD] +#[HEAD] +#[IF] $gpslatitude $gpslongitude $gpsdatetime +#[BODY] +#[BODY] +#[BODY] $gpsaltitude# +#[BODY] $GPSHPositioningError# +#[BODY] +#[BODY] +#[BODY] $gpsspeed3d# +#[BODY] +#[TAIL] +#[TAIL] +#[TAIL] diff --git a/lib/video/source.ex b/lib/video/source.ex index f02196ad..679c863c 100644 --- a/lib/video/source.ex +++ b/lib/video/source.ex @@ -79,7 +79,7 @@ defmodule Video.Source do @spec timed_points_with_gpx(t()) :: [Video.TimedPoint.t()] | {:error, binary()} def timed_points_with_gpx(%__MODULE__{source: source, available_gpx: false}) do {:error, - "#{Video.Path.source_base_with_ending(source)} has no GPX file available to extract time range from, try `gopro2gpx -s #{Video.Path.source(source)}`?"} + "#{Video.Path.source_base_with_ending(source)} has no GPX file available to extract time range from, try `exiftool -extractEmbedded -ignoreMinorErrors -printFormat data/gpx_extended.fmt -binary -textOut gpx #{Video.Path.source(source)}`?"} end def timed_points_with_gpx(%__MODULE__{} = self) do