How to add title metadata to videos with AppleScript?
0
votes
0
answers
337
views
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?
Asked by ʀ2ᴅ2
(1084 rep)
Aug 17, 2018, 07:38 PM