Edit Category of MP4 file

Started by trymeout, April 30, 2021, 05:09:26 PM

Previous topic - Next topic

trymeout

How do you edit the category metadata of a MP4 file?

Here is a same video which has the category set to "John Doe, Mary Doe"
https://ufile.io/0d52fc80

StarGeek

You would write to the Microsoft:Category tag.  It is a list type tag so everything is FAQ #17 applies.

To replace the categories in your example video, which started with John Doe, Mary Doe
C:\>exiftool -P -overwrite_original -Microsoft:Category="Indiana Jones" -Microsoft:Category="Han Solo" Y:\!temp\dddd\ShortVideo.mp4
    1 image files updated

C:\>exiftool -g1 -a -s -Microsoft:Category Y:\!temp\dddd\ShortVideo.mp4
---- Microsoft ----
Category                        : Indiana Jones, Han Solo


To add categories without replacing
C:\>exiftool -P -overwrite_original -Microsoft:Category+="John Doe" -Microsoft:Category+="Mary Doe" Y:\!temp\dddd\ShortVideo.mp4
    1 image files updated

C:\>exiftool -g1 -a -s -Microsoft:Category Y:\!temp\dddd\ShortVideo.mp4
---- Microsoft ----
Category                        : Indiana Jones, Han Solo, John Doe, Mary Doe

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

trymeout

This is what I get as an output in the terminal with the first command you given me.

$exiftool -P -overwrite_original -Microsoft:Category="Indiana Jones" -Microsoft:Category="Han Solo" ShortVideo.mp4
Warning: Sorry, Microsoft:Category doesn't exist or isn't writable
Warning: Sorry, Microsoft:Category doesn't exist or isn't writable
Nothing to do.


I am on Linux Mint if that helps

StarGeek

The ability to write Microsoft tags was added in version 12.20.  You'll need to update to a newer version.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

trymeout

Darn, I will have to wait until exiftools is updated on my distro

trymeout

Wont this work also?

exiftool -P -overwrite_original -Microsoft:Category="Indiana Jones, Han Solo" ShortVideo.mp4


instead of using this.

exiftool -P -overwrite_original -Microsoft:Category="Indiana Jones" -Microsoft:Category="Han Solo" ShortVideo.mp4

StarGeek

No, that will make a single entry of
"Indiana Jones, Han Solo"
when what you want would be
Indiana Jones
Han Solo

Category is a list type tag, not a comma separated string.  Make sure and read the FAQ 17 I linked above.

A good visual example would be to look at the raw XMP of a list type tag, such as Subject
<rdf:Description rdf:about=''
  xmlns:dc='http://purl.org/dc/elements/1.1/'>
  <dc:subject>
   <rdf:Bag>
    <rdf:li>One</rdf:li>
    <rdf:li>Two</rdf:li>
   </rdf:Bag>
  </dc:subject>
</rdf:Description>
</rdf:RDF>


As you can see, the two keywords, "One" and "Two" are completely separate.  While Microsoft:Category doesn't use the same format as it's not XMP, the idea is the same.  Each entry is completely separate.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

trymeout

Good to know, would this command delete the Category metadata fully from the file?

exiftool -P -overwrite_original -Microsoft:Category="" FILE.mp4

StarGeek

Quotes aren't needed, simply -Microsoft:Category= will do.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

trymeout

Excellent, thank you for helping me again!