Author Topic: Date & Time in video files  (Read 2006 times)

ben

  • Hero Member
  • ***
  • Posts: 524
Date & Time in video files
« on: October 07, 2017, 07:51:08 AM »
Good morning everyone,

i am trying to clean up a bunch of video files and got stuck with the date/time information saved in those files.
I recall Mario saying once, that "metadata in videofiles is even a greate mess than in normal images".

I collect files also from friends, thus ending up with at least 5-8 different camera sources:
  1) jpgs have the correct date/time written into the metadata and the filenames
  2) videos have the correct date/time in the filenames, but not in the metadata
  3) Some videos seem to have nearly correct metadata but leave out the timezone information
  4) the camera model is written into jpgs, but not into video files ({File.MD.Exif::Main\272\Model\0})
  ...

How do you handle or correct the date/time information of your video files?
I appreciate all of you comments.

Ben


Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 30082
Re: Date & Time in video files
« Reply #1 on: October 07, 2017, 07:57:30 AM »
There is no standard. Some vendors embed a sort of EXIF in their video files. Others use QuickTime metadata or whatever.
IMatch can maintain a proper XMP record for all file formats so this should be your way to go. Somehow get the proper date and time into the XMP date and time fields and you're set. Usually this is easiest and quickest by hand, unless you have hundreds of videos.

For the video files with EXIF data you'll have a problem. If ExifTool can read the EXIF, it will and thus update the XMP timestamps from that. But if you change the XMP timestamps in IMatch, IMatch cannot synchronize them back into the video files (ExifTool does not write video files for good reasons). This may cause your updated timestamps to be overwritten during the re-import.

The big players in the marked are not interested in setting up a standardized metadata management for video files. They spend two years to develop new and more efficient video compressors (good) and then cripple them with 50 patents so everybody has to pay in order to be allowed to render these videos (MPEG group). During all that they obviously have to time to thing about things like allowing users to associate proper metadata with videos.

There are various non-standard approaches, container formats, more metadata variations than for MP3 files at this time. It is truly a mess.

hluxem

  • Sr. Member
  • **
  • Posts: 332
Re: Date & Time in video files
« Reply #2 on: October 07, 2017, 02:05:34 PM »
Hello Ben,

For video files with the date in the file name I use a meta data template and change the XMP::photoshop\DateCreated and XMP::xmp\CreateDAte tags. My filenames are YYYY-MM-DD hh-mm-ss and I use below to fill the tags:

{File.Name|substr:0,4}:{File.Name|substr:5,2}:{File.Name|substr:8,2} { File.Name|substr:11,2}:{File.Name|substr:14,2}:{File.Name|substr:17,2}-05:00

with -05:00 as the time zone. That works well for most movies, it will create an xmp sidecar file with the tags.
I had one case where the camera included exif data in the file and exif tool is not going to work with movie files as Mario already mentioned. The solution for me was to add the movie file to an container or encode and compress it with ffmpg. I ended up batch compressing this movie clips with ffmpg as the files got much smaller without visible degradation. That sounds complicated, but it is really fairly easy after doing some research. If you run into this problem, I can post some more information on how to do that.

Heiner

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 30082
Re: Date & Time in video files
« Reply #3 on: October 07, 2017, 02:33:49 PM »
Wrapping the EXIF files into a container is a good idea. Which container format did you use?

hluxem

  • Sr. Member
  • **
  • Posts: 332
Re: Date & Time in video files
« Reply #4 on: October 07, 2017, 04:36:47 PM »
Quote
Which container format did you use?

I used mp4 and tested with the following batch command with the free ffmpeg tool:

for %%a in ("*.avi") do ffmpeg -i in.mp4 -c:a copy out.mp4  pause

I believe that did just wrap the stream in a container with no encoding.

I decided to compress the files and used the following command:

for %%a in ("*.avi") do ffmpeg -i "%%a" -c:v libx265 -preset slow -crf 24 -c:a aac -b:a 128k "newfiles\%%~na.mp4"
pause

This cut down the file size a lot without any visible effect.


Heiner





Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 30082
Re: Date & Time in video files
« Reply #5 on: October 07, 2017, 05:15:12 PM »
Thanks for sharing.

ben

  • Hero Member
  • ***
  • Posts: 524
Re: Date & Time in video files
« Reply #6 on: October 11, 2017, 11:40:34 AM »
Thanks a lot for your comments.

Based on your information i wrote a small app, that helps to set the correct date.
It displays differents date-sources from the metadata, the user can select from. Then it updates all files based on this selection (of cource for each file with the corresponding date).
For files that have the date written into the filename, this date can be used as source as well.

If someone is interested in it, i can share it.

Ben

jch2103

  • Oldtimer
  • ****
  • Posts: 2265
Re: Date & Time in video files
« Reply #7 on: October 11, 2017, 06:23:57 PM »
...i wrote a small app, that helps to set the correct date.
...
If someone is interested in it, i can share it.

This sounds like it could be useful; video files are quite aggravating re dates. Could you post the app? Thanks.
John

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 30082
Re: Date & Time in video files
« Reply #8 on: October 11, 2017, 06:33:27 PM »
I use a Metadata Template for that purpose.
Just to point out an alternative solution which does not require an app.

ben

  • Hero Member
  • ***
  • Posts: 524
Re: Date & Time in video files
« Reply #9 on: October 11, 2017, 08:29:59 PM »
Quote
I use a Metadata Template for that purpose.
True, i do this as well.
Metadata templates are really great for so many different things.
The app should simplify the work with video files a bit for me.


Shared the app:
https://www.photools.com/community/index.php?topic=7249.0