Moving to a Plex Media Server I realized a majority of my video archive doesn't have metadata and when I render the videos through Plex's UI I see Episode # when I want it to render as Episode Foobar.

Per research (add new and non defined metadata to a mp4 file) I found that ffmpeg can be used so I did a brew install ffmpeg and verified with a man ffmpeg it was present.

Built my AppleScript to detect the volume, load the folder contents as a list, take the formatted name for plex, example:

- Foo Bar
-- Foo Bar - s01e01 - Into the Foo.mov
-- Foo Bar - s01e02 - Into the Bar.mp4

Everything after s##e## - but before . as the title, such as:

ffmpeg -i Foo Bar - s01e01 - Into the Foo.mov -metadata title="Into the Foo" Foo Bar - s01e01 - Into the Foo.mov

I verify the title was modified with:

ffprobe -v quiet -print_format json -show_format -show_streams Into the Foo" Foo Bar - s01e01 - Into the Foo.mov > result.json

and under format I see:

"format": {
        "filename": "Foo Bar - s01e01 - Into the Foo.mov",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "652.342000",
        "size": "13507029",
        "bit_rate": "165643",
        "probe_score": 100,
        "tags": {
                "major_brand": "qt  ",
                "minor_version": "512",
                "compatible_brands": "qt  ",
                "title": "Into the Foo",
                "encoder": "Lavf58.12.100"

but with a do shell on the quoted form. When I load it to Plex and run an update then run a Refresh Metadata the titles still render as:

Episode 1
Episode 2

in AppleScript how can I properly add the metadata to read file title metadata on videos? Is there another approach to this I'm missing?

  • I don't think this is an AppleScript problem. It's a Plex problem. I've used Plex (and Kodi and Emby) all quite extensively. 90% of Plex's purpose (or any media server's purpose) is to organise films and TV shows and create metadata for each film and episode so that it the server can serve up useful, helpful information about the media (episode names, plot summary, running time, even codec information). You shouldn't have to be doing any of this. I recommend looking at your Plex settings and configuration profiles. – CJK Aug 17 '18 at 23:09
  • Some Plex forum posts here, here, and here – CJK Aug 17 '18 at 23:16

You must log in to answer this question.

Browse other questions tagged .