mickle026 650 Posted October 17, 2025 Posted October 17, 2025 (edited) Built for server 4.8.11 + TV&Movie Theme Provider Plugin Overview TV&Movie Theme Provider automatically locates, downloads, or extracts theme music for Movies and TV Series in your Emby library. It integrates multiple free and legal providers — Archive.org, TelevisionTunes, MixKit, and BBC Rewind — with an optional local FFmpeg extractor for generating clean intro/outro MP3 clips directly from your media. The plugin runs as a scheduled Emby task and provides a full Dashboard configuration page featuring live log output, WebSocket updates, and library scan statistics. Step-by-Step Operation Library Scan The scheduled task queries the Emby library through ILibraryManager. TV Series are processed first by default; Movies optionally included. Theme Detection For each item, the plugin searches theme sources in order: Archive.org TelevisionTunes.co.uk MixKit.co BBC Rewind (musicmemories.bbcrewind.co.uk) Download or Extraction If no theme is found online, FFmpeg extracts 45 seconds of audio from the start or end of the video. The extraction uses: bash -t 45 -af silenceremove=start_periods=1:start_threshold=-40dB ensuring silence is trimmed. Storage Themes can be saved in the media’s folder or a cache directory, based on user settings. Fingerprint & Metadata Each successful theme creates a theme_meta.json with SHA-256 fingerprint, provider, licence, and timestamp. Dashboard Feedback A WebSocket channel TVThemeProvider streams progress messages to the dashboard page (tvthemeprovider.html / .js). Users see real-time status, provider name, progress bar, and log output. Process Flow flowchart TD A[Start Task] --> B[Load Plugin Config] B --> C[Query Library (Series / Movies)] C --> D{Existing Theme?} D -->|Yes| E[Skip] D -->|No| F[Try Providers<br>Archive→TelevisionTunes→MixKit→BBC Rewind] F -->|Found| G[Save MP3 + JSON Metadata] F -->|Not Found| H[Extract with FFmpeg<br>Trim Silence 45 s] H --> I[Compute Fingerprint] G --> I I --> J[Broadcast via WebSocket] J --> K[Next Item] K --> L[Complete + Summary] Conclusion The TVThemeProvider Plugin is a complete, legally-safe theme music engine for Emby. It automatically retrieves or extracts high-quality theme MP3s, maintains consistent metadata, and keeps you informed in real time via a responsive dashboard. With BBC Rewind support and WebSocket integration, this plugin enriches your media library MediaBrowser.Plugins.TVThemeProvider.dll MixKit and BBC Rewind have been removed , MixKit is unauthorised and contains samples anyway so is not valid, BBC Rewind have removed the media and discontinued but left their api up, so 404's galore. That one is a shame Fixed tv Series extractions and added code to honour intro markers, although I havent tested it yet. Im away for the week now, so I have posted it anyway, im sure you ll let me know if it aint working MediaBrowser.Plugins.TVThemeProvider.1.0.0.1.zip Edited October 20, 2025 by mickle026 3
mickle026 650 Posted October 17, 2025 Author Posted October 17, 2025 4 hours ago, GrimEvil said: Does this work with .strm files as well? Not tested that, so truthfully - no idea. Theory though, it might. It reads movies and TV shows listed in the library, not necessarily valid media containers. 1
GrimReaper 4739 Posted October 17, 2025 Posted October 17, 2025 Small suggestion: you could insert logic between online sources check and FFmpeg 45s extract to check for IntroSkip markers - if found, FFmpeg extract from that time onwards as that part is extremely likely to contain music theme, if not, proceed to regular 45s (or whatever) extract. 2
mickle026 650 Posted October 17, 2025 Author Posted October 17, 2025 2 hours ago, GrimReaper said: Small suggestion: you could insert logic between online sources check and FFmpeg 45s extract to check for IntroSkip markers - if found, FFmpeg extract from that time onwards as that part is extremely likely to contain music theme, if not, proceed to regular 45s (or whatever) extract. To be fair that's a good idea. I had thought about intro skip when I added the JSON output file with it, keeping fingerprints of them, so that if I decide to later can match episodes or related material with them. 1
geowill76 8 Posted October 18, 2025 Posted October 18, 2025 (edited) I have installed the plugin but can't get it to work with my TV shows - Extraction failed or empty output for 'Prodigal Son (2019)'. It is happening on all my TV Shows. My TV shows are setup as \\TV Shows\Prodigal Son (2019)\Season 1 with all my files located per season folder How should the plugin work, especially for TV Shows? Edited October 18, 2025 by geowill76
mickle026 650 Posted October 18, 2025 Author Posted October 18, 2025 7 hours ago, geowill76 said: I have installed the plugin but can't get it to work with my TV shows - Extraction failed or empty output for 'Prodigal Son (2019)'. It is happening on all my TV Shows. My TV shows are setup as \\TV Shows\Prodigal Son (2019)\Season 1 with all my files located per season folder How should the plugin work, especially for TV Shows? Ok , I see it's all my fault, I've entered the wrong type in the part that extracts for tvshows, it's currently trying to extract from the TV show, not the episode, so there is actually no media at top level. I will fix it when I have chance, might be next weekend now. Thanks for reporting 1
Oratorian 41 Posted October 19, 2025 Posted October 19, 2025 (edited) Does your extraction try to detect intros? Not every TV-Show presents and opening theme in the first 90 secs. and all requests to BBC Rewind fail 2025-10-19 01:44:56.226 Info App: [BBCRewind] Searching https://musicmemories.bbcrewind.co.uk/api/themeTuneRecords?search=Die%20Tageb%C3%BCcher%20der%20Apothekerin 2025-10-19 01:44:56.367 Warn App: [BBCRewind] Error fetching Die Tagebücher der Apothekerin: Response status code does not indicate success: 404 (Not Found). Looks Edited October 19, 2025 by Oratorian
geowill76 8 Posted October 19, 2025 Posted October 19, 2025 (edited) Extraction tries to detect intro [10:37:39] 🎞 Extracting 45s of 'Misfits (2009)' (Start)... [10:37:39] Extraction failed or empty output for 'Misfits (2009)' [10:37:41] No theme found for 'Misfits' Entries below from log file 2025-10-19 10:31:38.087 Info App: [BBCRewind] Searching https://musicmemories.bbcrewind.co.uk/api/themeTuneRecords?search=Hijack 2025-10-19 10:31:38.213 Warn App: [BBCRewind] Error fetching Hijack: Response status code does not indicate success: 404 (Not Found). 2025-10-19 10:35:31.587 Info App: [BBCRewind] Searching https://musicmemories.bbcrewind.co.uk/api/themeTuneRecords?search=Breaking Bad 2025-10-19 10:35:31.722 Warn App: [BBCRewind] Error fetching Breaking Bad: Response status code does not indicate success: 404 (Not Found). Does the above for all TV Shows Just to add the plugin was able to successfully scan my Movies folder and extracted theme song. Edited October 19, 2025 by geowill76
mickle026 650 Posted October 19, 2025 Author Posted October 19, 2025 I will get back to this, i knew about not extracting from tv shows from earlier posts, and will add to my task list fix BBC Rewind downloads. I plan to add a variable extraction time based on intro markers if they exist too. Thanks for trying it, and reporting
geowill76 8 Posted October 20, 2025 Posted October 20, 2025 Hi, thanks for the update to the plugin. I have installed it on my sever and seems to be working. Just wanted to show you extract of what the plugin is doing [10:21:23] [98%] Saved 'Butterfly (2025)' via Local Media (Start) [10:21:23] [98%] Attempting local extraction from: s01e02 - Episode 2.mkv [10:21:23] [98%] 🎞 Extracting 45s of 's01e02 - Episode 2.mkv' (Start)... [10:21:24] [98%] Extracted theme from media (45s, start offset 0.0s) Not sure if the above is meant to happen but I noticed during the scan that sometimes it was extracting audio from episode 1 but a lot of times it was randomly picking an episode to extract the audio from Also, I see the plugin has created a theme.mp3 file as well as the a theme_meta json file for the theme. When I go to the relevant TV Show, Emby won't play the theme song. However, if I go into the folder and open theme.mp3 file my media player software plays the theme song. Not sure why Emby isn't recognising there is a theme file in the folder. I did notice in my Emby log file the following, that seems to be happening for any theme the plugin has created for TV Shows 2025-10-20 10:21:22.619 Debug LibraryMonitor: Change detected to \\192.168.10.3\TV Shows\Butterfly (2025)\theme.mp3 2025-10-20 10:21:22.619 Debug LibraryMonitor: New file refresher created for \\192.168.10.3\TV Shows\Butterfly (2025)\theme.mp3 2025-10-20 10:21:23.411 Debug LibraryMonitor: Change detected to \\192.168.10.3\TV Shows\Butterfly (2025)\theme.mp3 2025-10-20 10:21:23.443 Warn App: [TVThemeProvider] Failed to copy theme for Butterfly (2025): The process cannot access the file '\\192.168.10.3\TV Shows\Butterfly (2025)\theme.mp3' because it is being used by another process. However, the theme files that were downloaded for my Movies all seem to work fine through Emby.
geowill76 8 Posted October 20, 2025 Posted October 20, 2025 Hi Out of the blue I decided to run Scan Media Library and Scan Metadata folder now that the plugin has completed downloading the theme files for TV shows. Looks like themes are now playing through Emby for the shows the plugin downloaded themes for. Seems you have to run a scan after the plugin has completed downloading theme files for Emby to pick them up. 1
mickle026 650 Posted October 20, 2025 Author Posted October 20, 2025 I will look at the file lock when copying it to a cached folder, you don't need this it's only to keep a backup copy. I am not at home until the weekend so cannot until then. Yes you will need emby to pick them up, so a scan is needed.
geowill76 8 Posted October 20, 2025 Posted October 20, 2025 Hi Mickle026 Thanks for the plugin. Just to let you know that I have not enabled the cached folder option so don't have any folder created at /cache/TVThemes for the files to keep a backup copy Also, I see mention of a new feature you are looking to introduce - variable extraction time based on intro markers Would this solve the problem with some tv shows where the beginning starts off with a recap of previous episode before it gets to the intro with the theme music
mickle026 650 Posted October 20, 2025 Author Posted October 20, 2025 It's a difficult thing to do, because Its beyond my personal capability to detect whether it's speech or not. I have added code to vary the time based on intro markers created by emby if they exist but have not checked that is working, I'm not home for most of the next week so can't.check yet. I will add to my todo list to check if it's trying to copy to a cache when not enabled.
mickle026 650 Posted October 20, 2025 Author Posted October 20, 2025 It is supposed to use any episode to extract from unless you specify the first found in the options. That is by design. If want to ensure no recap speech then turn the first episode option on or put a different theme.mp3 in that directory. The ideal scenario would be for me to add a decent editor to do individual ones, that's possible, and/or have an ignore option of some sort, such as an ". ignore_theme" file in the directory but not currently on the agenda.
geowill76 8 Posted October 20, 2025 Posted October 20, 2025 Thanks for all the info. I had the first episode option turned on which is why I thought it best to report that during the scan that sometimes it was extracting audio from episode 1 but a lot of times it was randomly picking an episode to extract the audio from, just in case there was a bug that it was ignoring the first episode option being enabled. Overall the app has been great and has created a lot of tv show and movie theme songs that I was struggling to get.
mickle026 650 Posted October 21, 2025 Author Posted October 21, 2025 13 hours ago, geowill76 said: Thanks for all the info. I had the first episode option turned on which is why I thought it best to report that during the scan that sometimes it was extracting audio from episode 1 but a lot of times it was randomly picking an episode to extract the audio from, just in case there was a bug that it was ignoring the first episode option being enabled. Overall the app has been great and has created a lot of tv show and movie theme songs that I was struggling to get. I will recheck the code and see if I can see if it's misbehaving when I get back, thanks for reporting. I will also check it it is honouring existing into markers, because that'll be the length of the theme music for that item. I didn't have time to check that before I left because my test server didn't have any markers set on the tvshows on it, I left the marker extraction running when I left. I should really have done all this before posting the plugin, but the plugin wasn't planned, I compiled it while testing something else, and did the first one in just a day, only minimally testing it. The plugin I am writing, that this is a spin-off from still isn't working properly - lol
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now