Metadata from video by frames

Started by DKutkevicius, October 16, 2023, 06:04:52 AM

Previous topic - Next topic

DKutkevicius

Hello everyone,

I am a new user of this tool and had a great success using it on different kind of images. I have tried to use it on video (mp4) and would like to know if there is a way to get metadata by frame and not for the whole video?

I have tried to use ffmpeg to convert video frames to jpegs and then run exif, but jpegs lost metadata.

Any input or recommendation would be really good! Thanks

Fodoh

Hi DKutkevicius,
JPEG tags are explained here:
https://exiftool.org/TagNames/JPEG.html

As you can see, most of the tags are not writeable. An exception is the "'COM'    Comment" Tag

- Fodoh

wywh

Movie and image metadata tags are different. So check which tags you want to copy from the movie and use exiftool's TagsFromFile command to copy them to the corresponding image tags.

Phil Harvey

Videos don't have metadata for each frame, but there is sometimes "timed metadata" which changes with time (for example, GPS may be recorded once per second).  ExifTool has the ability to read many types of timed metadata, but can't yet write it to videos.  Add the exiftool -ee3 option to extract as much timed metadata as possible.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

wywh

#4
If you just want to copy .mp4 metadata as a whole to an extracted .jpg try something like:

exiftool -m -overwrite_original -api QuickTimeUTC=1 -api LargeFileSupport=1 -TagsFromFile a.mp4 '-AllDates<QuickTime:CreateDate' '-FileCreateDate<QuickTime:CreateDate' '-FileModifyDate<QuickTime:CreateDate' '-Composite:GPSPosition<Composite:GPSPosition' '-GPSAltitude<GPSAltitude' '-XMP-photoshop:Headline<Keys:DisplayName' '-XMP-dc:Title<Keys:Title' '-XMP-photoshop:CaptionWriter<Keys:Author' '-XMP-xmp:Rating<Keys:UserRating' '-XMP-dc:Subject<Keys:Keywords' '-XMP-dc:Description<Keys:Description' '-IFD0:Make<Keys:Make' '-IFD0:Model<Keys:Model' '-IFD0:Software<Keys:Software' '-ExifIFD:LensMake<XMP-exifEX:LensMake' '-ExifIFD:LensModel<XMP-exifEX:LensModel' '-ExifIFD:LensInfo<XMP-exifEX:LensInfo' a.jpg
But check what tags the movie has because it varies wildly. Instead Keys, the tags might be in UserData or ItemList, Lens info might be in XMP-aux instead XMP-exifEX etc.

- Matti

StarGeek

Quote from: wywh on October 16, 2023, 09:40:01 AMIf you just want to copy .mp4 metadata as a whole to an extracted .jpg try something like:

One thing to watch for is that Keys:Keywords is a string, not a list, so copying it directly will create one long keyword.  The -sep option would be needed.  I don't know what it separates on (I'm guessing the usual CommaSpace), you would probably know what to separate on better than me.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

wywh

#6
Quote from: StarGeek on October 16, 2023, 11:25:18 AMKeys:Keywords is a string, not a list, so copying it directly will create one long keyword.  The -sep option would be needed

Good catch. I had previously done this only in the opposite direction from an image to a movie and did not notice that detail when reversing the command.

So the command above would indeed combine movie Keywords into one in a .jpg:

exiftool -a -G1 -s -v a.jpg
  | Subject = Keyword 1,Keyword 2

But adding...

-sep ','

...to the command correctly splits Keywords and does not seem to harm other tags with commas:

exiftool -a -G1 -s -v a.jpg
  | Subject = Keyword 1
  | Subject = Keyword 2
  | Description = Description 1,Description 2
  | Title = Title 1,Title 2
  | CaptionWriter = Author 1,Author 2
  | Headline = Headline 1,Headline 2

- Matti

DKutkevicius

Hello,

Thankyou all for you input, its really useful. I will definitely try out your suggestions and provide feedback after.

-Deividas