4

Circumstances

I recently started to extract frames from videos (GoPro) for underwater photography. I'm currently using Adobe Premiere Pro to do so, which works, but when I imported these new photos into Lightroom, I realized that the date/time metadata of the pictures don't match with the video's metadata (they have the date and time of when I extracted them, for obvious reasons).

This is really not convenient, since I need to manually re-adjust the time for each of these new pictures (I want all of my pictures to have accurate date/time metadata, since I often look back and want to know when I took these pictures).

Question

How can I extract a frame from a movie file and store the date/time metadata from the video to the frame? If this is possible, how can I store the time difference between the location of the frame and the start of the video?

Thank you very much.

  • Welcome Julian :) Please start with the tour: video.stackexchange.com/tour to get your first badge ;) Enjoy the site! – p2or Apr 11 '15 at 10:26
  • Good question. I think ideally you'd want the extracted frames to have the time/date stored in EXIF metadata, as well as (or instead of) file mod time. – Peter Cordes Apr 11 '15 at 11:49
  • Copying the file mod time from one file to another file is easy (touch file.jpg --reference=file.mp4 on GNU/Linux or cygwin), but IDK of any video frame grabbers that do that automatically. – Peter Cordes Apr 11 '15 at 11:51
  • Do you know if it'd be possible to have a small program that would go through an entire folder (where both the pictures and videos are) and do that automatically? The only issue would be that I create several frames for each video (or sometimes don't create a frame from another video). So if the video is named: GOPR2499, my frames are named GOPR2499.MP4.Still001 and GOPR2499.MP4.Still002 etc... – Julian Honma Apr 12 '15 at 14:09
  • I've taken 2 computer science class, so I can see how I could write a program that advances through each file, checks for IF statements and does stuff accordingly, but I just never wrote a program that affects files in my computer so I don't know what language to use or how to reference things in my computer. I know OCaml and JAVA which I both use on the IDE named Eclipse. – Julian Honma Apr 12 '15 at 14:16
1

If you are saving frames from PP using the snapshot tool, then by default it's saving a file that's of the form SEQUENCENAME_TIMECODE. If you know the date/time of the start of the sequence, you can compute frame-accurate metadata by adding the timecode of the image to the adjusted datetime of the sequence start. (By adjusted datetime, I mean that if your sequence starts at 01:00:00:00 and your actual clip was 16:20:25:15 on Apr 1, 2014, then you need to subtract one hour from the clip time to account for the SMPTE offset).

As for programming languages that will do what you want, look at bash (the Bourne Again Shell), Python, and/or Perl. Perl is wicked cool in how it can slice and dice strings, do math, and put the strings back together. But it is also wicked hard to learn idiomatically. Python may be the best starting point.

EXIFtool is a great way to embed correct metadata into image files: http://www.sno.phy.queensu.ca/~phil/exiftool/

And it's a way to learn some Perl while you are at it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.