ExifTool Forum

General => Metadata => Topic started by: jacklail on January 23, 2024, 12:03:47 AM

Title: Getting Plex to read tags in MP4 files
Post by: jacklail on January 23, 2024, 12:03:47 AM
I have been struggling to get Plex to read the metadata of my home video clips and stumbled on a solution that seems to work.

Plex says it reads a number of metadata fields, but for my "home videos" I am mostly interested in the fields labeled on Plex as "Title", "Summary" and "Date Released."

Plex's documentation says it reads "title," "description," and "year" and some others.

However, it's more specifically Quicktime "itemlist:title" for title and "itemlist:longdescription" for the "summary" field. If no sort title is specified, Plex seems to use itemlist:title.

However, when I added those or copied them from xmp-dc:title and xmp-dc:description, they wouldn't get picked up by the Plex scanner.

I also tested to no avail adding -api quicktimehandler=1 which has been suggested in some posts as something works with some Apple applications.

I was getting frustrated about this not working when I tried stripping the Quicktime tags first with -quicktime:all= and then running

exiftool '-itemlist:title<xmp-dc:title' '-itemlist:longdescription<xmp-dc:description' -year=YYYY -api QuickTimeHandler=1 file.mp4
... and Voila, it works!

I'm not sure why this works, but it does. Maybe Stargeek (who shares some notes on what Plex reads in another post) or Phil will have an explanation.

But if you have hit this wall with Exiftool and metadata for Plex video, give it a shot.

(Exiftool version 12.70 in a Debian container on a Chromebook.)



 
Title: Re: Getting Plex to read tags in MP4 files
Post by: Phil Harvey on January 23, 2024, 07:33:28 AM
Could you upload a sample where you wrote the tags with ExifTool but they weren't recognized by Plex?

- Phil
Title: Re: Getting Plex to read tags in MP4 files
Post by: jacklail on January 23, 2024, 12:52:40 PM
Here's a new copy of one of the problematic files.

They may be specific to the video editor, LumaFusion.

Test file:

Dropbox link (downloadable) (https://www.dropbox.com/scl/fi/tskars93zhpysb02dto87/2024-01-23_17_22_23_test.mp4?rlkey=lxomluctcakzot6g2x4v2xsi3&dl=0)

It seems to write this Quicktime tag

Handler Type : Metadata Tags

while QuickTimeHandler=1 writes

Handler Type : Metadata

So I end up with two. I do not see a way to delete just the Quicktime:Handler tag before using QuickTimeHandler=1. I think your documentation shows the Handler tag is not normally writeable.

If only Quicktime:handler=Metadata exists, it seems to work. If both exist, it does not. If only Quicktime:handler=Metadata Tags exists, it does not work.

Here is the code I ran after running my regular video metadata script.

exiftool '-itemlist:title<xmp-dc:title' '-itemlist:longdescription<xmp-dc:description' -api QuickTimeHandler=1 -ext mp4 INPUT.mp4
Thanks so much for looking at this. It there a way for the api option Quicktimehandler to overwrite the existing handler tag instead of becoming a second entry?
Title: Re: Getting Plex to read tags in MP4 files
Post by: Phil Harvey on January 23, 2024, 02:50:11 PM
I got the sample, thanks.  There is definitely something odd with the way the tags are written.  Sorry, but it will be helpful to also have an original sample before ExifTool wrote anything.  I'm thinking that ExifTool should be throwing a warning and/or fixing files with this problem.

- Phil

Edit:  I had thought the file was missing a Meta container, but I just missed it with my text search, so I don't see anything wrong actually.

Edit2: I wonder what happens if you take the bad file and do a -keys:all= to it.  Does Plex then read the information you wrote?
Title: Re: Getting Plex to read tags in MP4 files
Post by: jacklail on January 23, 2024, 03:54:21 PM
I created another one. Here is the file as exported.

https://www.dropbox.com/scl/fi/gamxhsxjgvy9ye9l58qff/test-export.mp4?rlkey=rrrn0xjlvtz63y3p0t0nbxx3x&dl=0 (https://www.dropbox.com/scl/fi/gamxhsxjgvy9ye9l58qff/test-export.mp4?rlkey=rrrn0xjlvtz63y3p0t0nbxx3x&dl=0)

I made a copy of it and added itemlist:title and itemlist:longdescription and they did not show up.

Title: Re: Getting Plex to read tags in MP4 files
Post by: jacklail on January 23, 2024, 03:59:12 PM
Quote from: Phil Harvey on January 23, 2024, 02:50:11 PM-keys:all=

I made another copy from the file that did not work and did the above. It works.

Can you explain a little about what happens in -keys:all=
Title: Re: Getting Plex to read tags in MP4 files
Post by: jacklail on January 23, 2024, 04:03:25 PM
I did not use the -api mediahandler=1 in these tests, but the Quicktime Handler Type is now Metadata instead of Metadata Tags.
Title: Re: Getting Plex to read tags in MP4 files
Post by: Phil Harvey on January 23, 2024, 04:08:14 PM
Somehow it seems that Plex is ignoring the ItemList tags if Keys tags exist before the video handler.  I don't know why that should happen, but removing these seems to fix things.  The Keys group is just another place to store metadata in QuickTime-format videos.

I don't think the -api QuickTimeHandler option should be necessary.

- Phil
Title: Re: Getting Plex to read tags in MP4 files
Post by: jacklail on January 23, 2024, 04:47:28 PM
Thanks so much Phil for following me down the rabbit hole! :D Hopefully, it will help someone else.
Title: Re: Getting Plex to read tags in MP4 files
Post by: Phil Harvey on January 23, 2024, 05:13:38 PM
Glad to help.

Actually, QuickTimeHandler=1 is the default since ExifTool 12.19 (Feb 2021).  So setting this option makes no difference.

- Phil