beetbox / mediafile

elegant audio file tagging
http://mediafile.readthedocs.io/
MIT License
97 stars 24 forks source link

Add additional ORIGINALDATE freeform mp4 tag for Plex support #70

Closed chrisbenincasa closed 10 months ago

chrisbenincasa commented 10 months ago

It seems that Plex does not properly detect the com.apple.iTunes:ORIGINAL YEAR' freeform tag (presented as ORIGINAL YEAR by ffmpeg).

After searching around the web for a little, it seems that Plex relies on ffmpeg output to determine tags of certain files. I've confirmed with a small script (https://gist.github.com/chrisbenincasa/3b518514fd2b0d3cc494dce82b84b3a7) that setting ----:com.apple.iTunes:ORIGINALDATE on m4a files (mimicking behavior of Vorbis) allows Plex to recognize the tag.

It doesn't seem as if Picard defines a mapping for this field (https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html) but the popular Typescript music-metadata library has mappings for to ORIGINALYEAR and ORIGINALDATE: https://github.com/Borewit/music-metadata/blob/master/doc/common_metadata.md

One way to fix this would be to append a second tag for m4a called ORIGINALDATE. I'm not sure what the implications of changing the existing tag would be... It would probably also be beneficial to set ORIGINALYEAR in a separate tag.