Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use date from GPS or exif #114

Open
wants to merge 19 commits into
base: development
Choose a base branch
from
Open

Conversation

inode64
Copy link
Contributor

@inode64 inode64 commented Apr 25, 2023

It can happen that the images are stored on a different date than the time they were actually taken.
Above all, it improves when using the GPS time, even if the real value of the position is incorrect, I have reviewed all my videos and when there is any position, the date is correct.
Then in the next step is to use exif because the files can be modified, you cannot trust the date of the file, you have to use exif
By the way, I have taken the opportunity to refactor the code that you had duplicated in the different cameras


Puede pasar que las imágenes se almacenan en una fecha diferente a la hora en que realmente hayan realizado.
Sobre todo se mejora al utilizar la hora GPS aunque el valor real de la posición sea incorrecto, he revisado todos mis videos y cuando existe cualquier posición la fecha es correcta.
Luego en el siguiente paso es utilizar exif porque se pueden modificar los archivos, no se puede uno fiar de la fecha del archivo, hay que utilizar exif
De paso he aprovechado para refactorizar el código que tenias duplicado en las diferentes cámaras

Type:

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

Camera:

  • GoPro
  • Insta360
  • DJI
  • Android
  • This PR adds a new camera

Component:

  • Core logic
  • Import
  • Merging
  • Firmware Update
  • Video Manipulation

Checklist before approval:

  • Linter pass
  • Build pass

@KonradIT
Copy link
Owner

I'd throw in a test case with the Extract GPS coordinates file. https://github.com/KonradIT/mmt/blob/development/pkg/gopro/location_test.go

Also, the Insta360 and DJI files don't have GPMF data, just Exif or file creation. Maybe pass CameraType to the function so it knows not to parse GPMF.

pkg/media/dates.go Outdated Show resolved Hide resolved
pkg/media/dates.go Outdated Show resolved Hide resolved
pkg/media/dates.go Outdated Show resolved Hide resolved
@inode64
Copy link
Contributor Author

inode64 commented Apr 25, 2023

I'd throw in a test case with the Extract GPS coordinates file. https://github.com/KonradIT/mmt/blob/development/pkg/gopro/location_test.go

Also, the Insta360 and DJI files don't have GPMF data, just Exif or file creation. Maybe pass CameraType to the function so it knows not to parse GPMF.

The process respects the other types of cameras.
I summarize the workflow that is used to find the correct time. Starting from the logic that the GPS and Exif data are more precise than the time of the file.

1º Search the mp4 videos for the GPS time when there is a location signal.
2nd search in the date in the GPS exif data.
3rd Look for the date in the Exif data "DateTimeOriginal", "DateTime", "DateTimeDigitized"
4º In case all of the above fails, use the time of the file.

@KonradIT
Copy link
Owner

Yes, but it'll be useless to do step 1 for DJI/Insta MP4 videos. Might as well skip it.

@inode64
Copy link
Contributor Author

inode64 commented Apr 25, 2023

better like this

@inode64
Copy link
Contributor Author

inode64 commented Apr 25, 2023

Ohh, Authenticated requests get a higher rate limit :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants