Subgen - Auto-generate Plex or Jellyfin Subtitles using Whisper OpenAI! reddit / selfhosted ---------------------------------------------------------------------- McCloud · 2023-10-24 17:28 Hey all, Some might remember this from about 9 months ago. I've been running it with zero maintenance since then, but saw there were some new updates that could be leveraged. **What has changed?** * Jellyfin is supported (in addition to the Plex and Tautulli) * Moved away from whisper.cpp to stable-ts and faster-whisper (faster- whisper can support Nvidia GPUs) * Significant refactoring of the code to make it easier to read and for others to add 'integrations' or webhooks * Renamed the webhook from webhook to plex/tautulli/jellyfin * New environment variables for additional control **What is this?** This will transcribe your personal media on a Plex or Jellyfin server to create subtitles (.srt). It is currently reliant on webhooks from Jellyfin, Plex, or Tautulli. This uses stable-ts and faster-whisper which can use both Nvidia GPUs and CPUs. **How do I run it?** I recommend reading through the documentation at: [McCloudS/subgen: Autogenerate subtitles using OpenAI Whisper Model via Jellyfin, Plex, and Tautulli (github.com)](https://github.com/McCloudS/subgen) , but quick and dirty, pull mccloud/subgen from Dockerhub, configure Tautulli/Plex/Jellyfin webhooks, and map your media volumes to match Plex/Jellyfin identically. **What can I do?** I'd love any feedback or PRs to update any of the code or the instructions. Also interested to hear if anyone can get GPU transcoding to work. I have a Tesla T4 in the mail to try it out soon. ---------------------------------------------------------------------- ggfools · 2023-10-24 21:23 this is cool, do you see a lot of incorrect word matches? ---------------------------------------------------------------------- McCloud · 2023-10-24 21:26 It's dependent on the file/audio, but overall it does fairly well. Or least well enough for you to contextually find out what the word is. I notice in busy/loud shows, like The Amazing Race, where you have multiple speakers or loud background noise, it won't do as well, but is still good. In scripted shows, like a sit-com, it does very well, rarely making mistakes. ---------------------------------------------------------------------- -plants-for-hire- · 2023-10-24 21:27 This is really interesting, I don't have a Nvidia GPU nor a powerful CPU. What sort of requirements do you reckon youd need for this? ---------------------------------------------------------------------- McCloud · 2023-10-24 21:30 It depends on how impatient you are or how often you want to make subtitles. On my i7-7700 on all cores using the medium model, it takes about 1-2 minutes per minute of video, obviously more if I'm doing other things. You might be able to get away reasonably well using the the tiny, base, or small models, I'm just not sure how accurate it is. ---------------------------------------------------------------------- TheBigC · 2023-10-24 21:31 This looks very cool, I am interested. Do I install it on the Plex server itself, or a pc running a plex client? ---------------------------------------------------------------------- -plants-for-hire- · 2023-10-24 21:33 ah okay thats a lot more reasonable than i was thinking, I have a 7500 but its often being utilised with other services. Is there a way to choose specific shows to subtitle, or perhaps only generate when shows don't already have subtitles available? ---------------------------------------------------------------------- McCloud · 2023-10-24 21:35 You can run it on anything, it just needs access to the media and able to access the server (Plex or Jellyfin) to receive/send webhooks. I did all building and troubleshooting on my Mac mini, then moved it to my server that also has my Plex for deployment. ---------------------------------------------------------------------- -plants-for-hire- · 2023-10-24 21:35 It looks like you would host it on the server, and when media gets added to plex, it will send a webhook to subgen which would then generate the subs ---------------------------------------------------------------------- McCloud · 2023-10-24 21:37 Is there a way to choose specific shows to subtitle: No only generate when shows don't already have subtitles available: Yes, if Subgen doesn't detect an INTERNAL sub, it will run on it (depending on your settings). It currently doesn't detect or care about external subtitles, as I generate both and use Bazaar and use whichever is better. ---------------------------------------------------------------------- Vogete · 2023-10-24 21:39 I didn't know this project existed and j genuinely was thinking making this tool. This is amazing, thank you! I'll definitely try it out, especially since I have a hard time finding subtitles for a lot of shows with proper sync. ---------------------------------------------------------------------- -plants-for-hire- · 2023-10-24 21:41 > Is there a way to choose specific shows to subtitle: No this could be a future feature to add - i have a few shows that were live tv rips and the subtitles are badly delayed which i would love to replace. I'll give this a try and hopefully the generation isnt too slow/resource intensive for my CPU ---------------------------------------------------------------------- -plants-for-hire- · 2023-10-24 21:41 > Is there a way to choose specific shows to subtitle: No this could be a future feature to add - i have a few shows that were live tv rips and the subtitles are badly delayed which i would love to replace. I'll give this a try and hopefully the generation isnt too slow/resource intensive for my CPU ---------------------------------------------------------------------- -plants-for-hire- · 2023-10-24 21:41 > Is there a way to choose specific shows to subtitle: No this could be a future feature to add - i have a few shows that were live tv rips and the subtitles are badly delayed which i would love to replace. I'll give this a try and hopefully the generation isnt too slow/resource intensive for my CPU ---------------------------------------------------------------------- -plants-for-hire- · 2023-10-24 21:41 > Is there a way to choose specific shows to subtitle: No this could be a future feature to add - i have a few shows that were live tv rips and the subtitles are badly delayed which i would love to replace. I'll give this a try and hopefully the generation isnt too slow/resource intensive for my CPU ---------------------------------------------------------------------- Navajubble · 2023-10-24 21:42 Great project. I have hearing problems, and have to watch everything with subs. Luckily most stuff comes with it now, but it's so cool to have it sep. I used to use FileBot which got most of them (if they weren't already downloaded). ---------------------------------------------------------------------- McCloud · 2023-10-24 21:48 There are other OpenAI projects that will sync existing subs (https://github.com/m-bain/whisperX I think) does subtitle alignment). I haven't fussed with them though. ---------------------------------------------------------------------- TheBigC · 2023-10-24 22:14 Okay, thanks. I'll give that a shot. ---------------------------------------------------------------------- TheBigC · 2023-10-24 22:14 Thanks! Looking forward to trying this out. ---------------------------------------------------------------------- tablecontrol · 2023-10-24 22:23 holy crap!! i'm going to try this tonight. I was having some subtitle timing issues on Breaking Bad that was driving me nuts ---------------------------------------------------------------------- JoNike · 2023-10-24 22:24 What a cool project! Good job! ---------------------------------------------------------------------- ThreeLeggedChimp · 2023-10-24 22:36 I wonder if this could be adapted to work on intel GNA ---------------------------------------------------------------------- Snuupy · 2023-10-24 22:40 Wow, this is great! I'd be interested in doing some subtitles for some non-English shows I have, would you happen to know how it might perform with translating to English? Also, take a look at https://github.com/m-bain/whisperX - subsai uses this and it's much faster than whisper.cpp ---------------------------------------------------------------------- McCloud · 2023-10-24 22:49 It should detect the foreign language and make english subtitles, but I haven't personally tried it. I'm not using whisper.cpp anymore. I did some short comparisons between WhisperX and stable-ts and ultimately decided to go with stable-ts. Functionally, I'm sure they're very similar. ---------------------------------------------------------------------- McCloud · 2023-10-24 22:53 As far as I know, Whisper doesn't directly support OpenVino, so it hasn't been flowed to stable-ts or WhisperX. ---------------------------------------------------------------------- nullx · 2023-10-24 22:53 Like just last week I set up bazarr and was delighted to learn that it has a similar feature to this and it works great (with a GTX 1070).. I would have set your project up in lieu of bazarr, but I liked how bazarr searches other sources and does a lot of other stuff in regards to also fixing+syncing existing subtitles. Do you have any plans on anything similar to these bazarr features or maybe potentially even creating a provider for bazarr? ---------------------------------------------------------------------- McCloud · 2023-10-24 22:57 Honestly, when I started this back when, Bazarr has no intent of integrating Whisper. Now that they have... It would probably better if they just updated their image with different models and options. Nothing would prohibit me from adding a webhook to be triggered by Bazaar, I just haven't looked into it (and it seems redundant now). ---------------------------------------------------------------------- TheJambo · 2023-10-24 23:07 Damn this looks good, any chance of it coming to Emby? ---------------------------------------------------------------------- McCloud · 2023-10-24 23:22 Looking at the image they use.. I may be able to reproduce the webhooks to be directly usable in Bazarr. Might take a look at it tonight. ---------------------------------------------------------------------- McCloud · 2023-10-24 23:22 If I knew what the endpoints were, nothing would prohibit it. I can add it to my short list. ---------------------------------------------------------------------- Snuupy · 2023-10-25 00:08 Ah ok I'll give it a try! Thanks for the insight. ---------------------------------------------------------------------- nullx · 2023-10-25 00:28 That would be awesome, thanks! ---------------------------------------------------------------------- acdcfanbill · 2023-10-25 00:35 Awesome, I'd love to have this for something like my Taxi dvds, which all didn't have subtitles! ---------------------------------------------------------------------- Evajellyfish · 2023-10-25 00:41 Wow this is amazing, haven't had the chance yet to read all the documentation so thought id ask here, but does anyone know if this allows for you to select the language of subtitles you want? Say English > Korean or Korean > English? ---------------------------------------------------------------------- McCloud · 2023-10-25 00:54 Unfortunately, the Whisper model was only trained to convert into english, not other languages. ---------------------------------------------------------------------- McCloud · 2023-10-25 01:19 I just tried, Emby won't actually send out the webook on an action. I can use the test webhook, but it won't trigger off media actions. Documentation half-implies that it's a premiere options? ---------------------------------------------------------------------- onedr0p · 2023-10-25 02:47 Are there any plans to make this with the [Google Coral Device](https://coral.ai/products/accelerator/) (if that's even possible)? ---------------------------------------------------------------------- Supertrinko · 2023-10-25 03:32 Can this translate too? I watch a lot of old Hindi and Marathi movies with my wife, and a lot just don't have subtitles. ---------------------------------------------------------------------- spookymulderfbi · 2023-10-25 04:31 Very cool! If plex still had plugin support, this is the kind of stuff i'd want to see ---------------------------------------------------------------------- RaiseRuntimeError · 2023-10-25 04:37 I was reading the docs for both openai-whisper and faster-whisper and it can translate to English ---------------------------------------------------------------------- McCloud · 2023-10-25 05:04 In theory, if the language is in the model is should be able to detect to translate to english. I don't have any personal examples. According to https://help.openai.com/en/articles/7031512-whisper-api- faq ... both Hindi and Marathi are supported. ---------------------------------------------------------------------- berrywhit3 · 2023-10-25 06:54 Loos really promising! If you support Emby too that would be very nice as it's my current choice for media consumption :D. ---------------------------------------------------------------------- Adam_Meshnet · 2023-10-25 09:27 Nice! Do you reckon with GPU you could potentially run it in real time? I've set up an endpoint with Whisper to transcribe videos one of my colleagues needed for work on my homelab server, which cumulatively must have saved everyone days worth of time by now. ---------------------------------------------------------------------- dontquestionmyaction · 2023-10-25 10:07 Whisper JAX works on Kaggle TPUs, but not with Google Coral. ---------------------------------------------------------------------- PoundKitchen · 2023-10-25 10:46 Suhweeet!!! English only or will it handle other languages and translation too, Spanish to English? ---------------------------------------------------------------------- ovizii · 2023-10-25 10:46 I also use Bazarr and would like to know how to use this tool to generate subtitles only for the movies/shows which Bazarr does not find any subtitles for? Ideally placing them in the right place so plex/emby as well as Bazarr pick them up. If that is doable would you mind sharing some hints about the workflow? ---------------------------------------------------------------------- Totallynotaswede · 2023-10-25 10:57 This is Awesome! I'd love to help out with this! I was starting to write something similar to add hooks to audibookshelf so that it can scan through audiobooks to generate correct chapters / timings also, but it's better implementing this here. A good idea would to make the GPU / CPU transcoding a transcoding container, so that the main container can send out work to your gaming PC when it's online etc and the main container has scheduled jobs that it can trigger on the transcode nodes when available, there's lots of cool stuff that can be made, really fun project! Maybe we can create a discord channel for more people who are interested in developing this. ---------------------------------------------------------------------- UntouchedWagons · 2023-10-25 12:43 Can I have it generate subtitles for pre-existing files? ---------------------------------------------------------------------- McCloud · 2023-10-25 14:01 Not easily at this time. since it only triggers on media add or play. ---------------------------------------------------------------------- McCloud · 2023-10-25 14:01 It can only translate into English, but the source audio can be a foreign language. ---------------------------------------------------------------------- McCloud · 2023-10-25 14:02 Webhooks are only for premiere, so I can’t support it. ---------------------------------------------------------------------- berrywhit3 · 2023-10-25 14:28 I am myself a developer, so I could do it myself, but my last time C++ was loooong ago and I don't have time atm. I would pay you two months of premiere if you add support for Emby. ---------------------------------------------------------------------- McCloud · 2023-10-25 14:34 If you want, on the top of the github page is paypal donation link. I may be able to get to it tonight. ---------------------------------------------------------------------- berrywhit3 · 2023-10-25 14:34 Nice, thank you! Will send it when I got home and didn't forgot it lol. ---------------------------------------------------------------------- McCloud · 2023-10-25 14:58 I'm not sure yet. Faster-whisper has some benchmarks of the Largev2 model taking about 1 minute for 13 minutes of audio. Smaller models ought to be quicker. Unsure if the specs of the GPU will make much differenece. ---------------------------------------------------------------------- berrywhit3 · 2023-10-25 15:43 Donated two months for premiere, tell me if you need more time. ---------------------------------------------------------------------- Sirmiketr · 2023-10-25 17:09 Why not emby? ---------------------------------------------------------------------- McCloud · 2023-10-25 17:10 Emby webhooks are hidden behind premiere. Someone donated enough for me to buy a month integrate it. Will take a look at it tonight or tomorrow. ---------------------------------------------------------------------- PoundKitchen · 2023-10-25 17:54 Great, that's what I need! I see a Docker pull in my future. ---------------------------------------------------------------------- McCloud · 2023-10-25 20:24 I may be able to add this tonight with a new path defined, it will iterate all files recursively and find videos without internal subtitles and queue them. Just be known on large libraries, this will run for a long time on only a cpu. ---------------------------------------------------------------------- viceman256 · 2023-10-25 22:06 I'm getting all sorts of syntax errors going off your dockerfile. ---------------------------------------------------------------------- McCloud · 2023-10-25 22:07 I’ll re-pull it and take a look. Can you shoot me a screenshot or paste of it? ---------------------------------------------------------------------- viceman256 · 2023-10-25 22:21 Thank you. Using the default dockerfile from your github I get: parsing docker-compose.yml: yaml: line 1: did not find expected key I tried making changes such as copying formatting from working yml files I have, I've also used a yaml formatting tool to confirm formatting is correct, so not sure why it's not working. If it works for you, it could be something local, but this is what I get with my adjustments. yaml: line 8: did not find expected '-' indicator Dockerfile up to line 8 (line 7 is environment): version: 3.7 (tried version 2 and 3.5 as well) services: subgen: container\_name: subgen tty: true image: mccloud/subgen:cpu environment: \- "WHISPER\_MODEL=medium" ---------------------------------------------------------------------- McCloud · 2023-10-25 22:28 Thanks. Looks like I was missing 'services' on the second line of the compose file. I updated it, you can repull and give it a shot or edit yourself. ---------------------------------------------------------------------- viceman256 · 2023-10-25 23:41 Thank you, I didn't even notice the Jellyfin line either, but that bypassed the error. Working on pathing, not having success so far. My Jellyfin instance is installed on my local Windows machine, and Docker is running in WSL. I have remote mappings for Sonarr, Radarr, etc but subgen's format of asking for the mapping within the docker install file is confusing me. I get syntax errors when attempting to map it to my Windows drive about an empty space behind the colon. Any ideas on that front? ---------------------------------------------------------------------- Maribel-han · 2023-10-26 01:02 How do I know if it's working/doing it's thing? I installed it but seens to be doing nothing ---------------------------------------------------------------------- McCloud · 2023-10-26 01:06 If you have a webhook properly setup, you will at least see some output in the docker logs and an increase in your CPU usage. ---------------------------------------------------------------------- Maribel-han · 2023-10-26 01:13 docker log says: [IP] - - [26/Oct/2023 01:11:51] "POST /plex HTTP/1.1" 200 - INFO:werkzeug:[IP] - - [26/Oct/2023 01:11:51] "POST /plex HTTP/1.1" 200 ---------------------------------------------------------------------- McCloud · 2023-10-26 01:19 Simplest way to test is set PROCMEDIAONPLAY and DEBUG and play a file. The Post 200 means they’re being received as valid from plex but not generating. Could be because you don’t have PROCMEDIAONPLAY enabled or there is an embedded sub already. ---------------------------------------------------------------------- Maribel-han · 2023-10-26 01:24 > An error occurred: [Errno 2] No such file or directory Added for transcription. Transcribing file: Error processing or transcribing : [Errno 2] No such file or directory Some time after, it posted this, could this perhaps be related to docker volume path for the library? i've set as: volumes: - "/mnt/video/Series:/tv" ---------------------------------------------------------------------- McCloud · 2023-10-26 01:26 Yeah, that means your volume is wrong. It needs to be identical to plex. ---------------------------------------------------------------------- Maribel-han · 2023-10-26 01:42 but I copied it exactly from the plex library configuration ---------------------------------------------------------------------- McCloud · 2023-10-26 01:51 Assuming they’re on the same machine, your volumes are wrong. If you access via shell does going to /tv on both plex and subgen put you in the same directory? ---------------------------------------------------------------------- Maribel-han · 2023-10-26 01:59 if i do: > docker exec -it 0af0dd9343c4 bash > root@0af0dd9343c4:/subgen# ls /tv it lists the same file and folder structure as: > ls /mnt/video/Series ---------------------------------------------------------------------- McCloud · 2023-10-26 02:05 So they’re on the same host and both have the identical volume assigned to them of /mnt/video/Series:/tv ? You can turn on debug, but it looks like your paths are messed up. Debug will tell you which path that subgen will use to find the video (which is sent from plex, that’s why they need the same mounts) ---------------------------------------------------------------------- Maribel-han · 2023-10-26 02:05 Idk if it's a factor, but subgen is running via docker and plex is running via apt on ubuntu server ---------------------------------------------------------------------- McCloud · 2023-10-26 02:08 Then you’ll want to change the subgen volume to probably be… /mnt/video/Series:/mnt/video/Series so it matches the pathing of your plex server. ---------------------------------------------------------------------- Maribel-han · 2023-10-26 02:38 yeah... that was the problem, now it's working properly, thanks! also, Can I add more volumes on the compose besides Movies and tv? because I have some non default libraries like, movies, animation movies, personal media, etc, etc... ---------------------------------------------------------------------- McCloud · 2023-10-26 02:42 Yup, you can add as many volumes on the compose file without any issues. ---------------------------------------------------------------------- McCloud · 2023-10-26 03:32 Added. ---------------------------------------------------------------------- McCloud · 2023-10-26 03:32 Just added it, let me know how it works! I didn't sit through a full transcribe, but everything appears to be triggering correctly. ---------------------------------------------------------------------- McCloud · 2023-10-26 03:36 https://github.com/McCloudS/subgen/blob/main/README.md#emby ---------------------------------------------------------------------- McCloud · 2023-10-26 04:52 Added. Take a look at TRANSCRIBE_FOLDERS on the github. ---------------------------------------------------------------------- berrywhit3 · 2023-10-26 05:54 That was fast, will try it later! ---------------------------------------------------------------------- AshipaEko · 2023-10-26 13:26 I'll appreciate some assistance with the script (can't run docker version as my device is ARM) looking at the getenv, where does my movies and shows paths go for a jellyfin install, and how? `use_path_mapping = convert_to_bool(os.getenv('USE_PATH_MAPPING', False))` `path_mapping_from = os.getenv('PATH_MAPPING_FROM', '/tv')` `path_mapping_to = os.getenv('PATH_MAPPING_TO', '/Volumes/TV')` `model_location = os.getenv('MODEL_PATH', '.')` `transcribe_folders = os.getenv('TRANSCRIBE_FOLDERS', '')` `if transcribe_device == "gpu":` `transcribe_device = "cuda"` `jellyfin_userid = ""` my media paths are: movies = /media/jellyfin/Movies shows = /media/jellyfin/Shows i normally have my subtitles in the same folder as media files so i'm not clear on Transcribe\_Folders lastly, what do i set as jellyfin\_userid? ---------------------------------------------------------------------- McCloud · 2023-10-26 14:35 Is your Jellyfin running in docker? What does its volume mapping look like? jellyfin\_userid isn't set by the user, you only need to set the server and token. Movies are supported, that's just an example path mapping. path\_mapping is used to fix the issue of disparate mapped directories (usually, between containers or between container to host). It's implemented similarly to [https://trash-guides.info/Sonarr/Sonarr- remote-path-mapping/](https://trash-guides.info/Sonarr/Sonarr-remote- path-mapping/) I didn't build an arm docker because you're probably going to have a bad time trying to run this on underpowered arm processors (like 10-12 hours for a single file). ---------------------------------------------------------------------- AshipaEko · 2023-10-26 14:53 Jellyfin is installed natively here i have set the token and server URL in the script, and setup the webhook in jellyfin. AFAIK there isn't anything happening when i add a file ---------------------------------------------------------------------- McCloud · 2023-10-26 14:57 If Jellyfin is natively installed, then you shouldn't need any pathing fixes, so use\_path\_mapping would be False. Did you install python3 and ffmpeg via your OS package manager? (apt- get install python3-pip python3 ffmpeg). If you aren't seeing any output set DEBUG=True and see if it puts out anything. I removed most outputs without debugging on because it was flooding the logs. ---------------------------------------------------------------------- Kaikidan · 2023-10-26 15:06 The app works perfectly, really nice idea! But I noticed something on my install, on the GitHub it mention that it will transcribe into English from other languages, but I tried Japanese and Portuguese files and they got transcribed at their native language portuguese > portuguese japanese > japanese english > english is that the expected behavior or should i add some argument on the docker compose to force translation into english? ---------------------------------------------------------------------- McCloud · 2023-10-26 15:13 It should always default to english as the subtitle/transcription because the language model is only trained in english... I'll take a look. ---------------------------------------------------------------------- McCloud · 2023-10-26 15:23 You're right, may have been missing an argument in the model. task="translate" wasn't defined. Pull the image again and let me know. ---------------------------------------------------------------------- Kaikidan · 2023-10-26 15:27 Ok! Thanks! I will pull the new image test again and report the results. ---------------------------------------------------------------------- McCloud · 2023-10-26 15:31 I added a new environment variable (see the docs) called TRANSCRIBE\_OR\_TRANSLATE. It defaults to translate, so should work for you. Out of curiosity are you using a GPU or CPU? ---------------------------------------------------------------------- Kaikidan · 2023-10-26 15:33 Cpu, kinda slow but does the job. ---------------------------------------------------------------------- AshipaEko · 2023-10-26 15:59 changed that to true, then added another file to test logs: [https://pastebin.com/9D9pE9Lu](https://pastebin.com/9D9pE9Lu) to be clear: this webhook is correct? https://imgur.com/a/QMeHb16 ---------------------------------------------------------------------- McCloud · 2023-10-26 16:07 Webhook should be [127.0.0.1:8090/jellyfin](https://127.0.0.1:8090/jellyfin) I don't recall if it needs http:// in front or not. Everything else looks good. ---------------------------------------------------------------------- Kaikidan · 2023-10-26 16:13 It’s working now! Thanks! Also is there a way to reset/delete the transcription queue? Some old files got stuck in it but refuses to be processed and/or be re-added to the queue (“file is already in the transcription list. Skipping”) , for the completed ones I just deleted the old generated SRT and it started generating the new one translated. ---------------------------------------------------------------------- McCloud · 2023-10-26 16:51 To clear the queue, close and rerun the script. I pushed a new change about 30 minutes ago where you can transcribe or translate. Takes either 'transcribe' or 'translate'. Transcribe will transcribe the audio in the same language as the input. Translate will transcribe and translate into English. ​ So you can go Japanese > English or Japanese > Japanese, but not Japanese > German ---------------------------------------------------------------------- McCloud · 2023-10-26 16:56 Added Emby support last night. ---------------------------------------------------------------------- McCloud · 2023-10-26 16:56 Added Emby last night. ---------------------------------------------------------------------- McCloud · 2023-10-26 16:58 Sorry, didn't see this until now. I didn't think about Windows path translation to Linux. I'll brainstorm on it tonight and let you know. ---------------------------------------------------------------------- viceman256 · 2023-10-26 18:13 You're the man, I appreciate you taking a look! I did apply a workaround based on the formatting of my other dockerfiles, but ran into another issue. For example, with my Sonarr, Radarr, Bazarr, etc. installations, I mount a volume in the dockerfile in this format: volumes: \- E:/Data/media:/video Then within the application, I map it as such: [https://imgur.com/zjnU8Fj](https://imgur.com/zjnU8Fj) For the dockerfile for subgen, I have attempted the following formats as it appears it requires the ${TV}/${Movies} entry and not a traditional volume mapping: \- ${TV}:"E:/Data/media/tv" \- "${TV}:E:/Data/media/tv" \- E:/Data/media/tv:${TV} But I get this error: \* error decoding 'volumes\[0\]': invalid spec: :"E:/Data/media/tv": empty section between colons Which appears to be related to the formatting of the volume with the ${} format. To workaround this, I changed it to the format of /tv instead of ${TV} which appears to be working now (unsure how to determine if it is or not, but no errors at least). \- E:/Data/media/tv:/tv Lastly I also replaced the part to map the local config directories, but ran into formatting issues with that. Format: \- D:/Docker/Subgen:/subgen It allows me to create the container, but won't boot with this error: 2023-10-26 13:00:59 python3: can't open file '/subgen/./subgen.py': \[Errno 2\] No such file or directory So I removed that part for now. Not sure if there is a way to adjust it for Windows path inclusivity, but redownloading every time isn't the end of the world. ---------------------------------------------------------------------- McCloud · 2023-10-26 18:23 The docker-compose has my mounts, {TV} and {Movies} are defined in a docker .env file, so it won't work for anyone else. Your volume should probably be...: - "E:/Data/media:/video" Assuming plex access your libraries at E:/Data/media. Then you'll enable path mapping and set from to: E:/Data/media and to: /video You're write about the D:/Docker/Subgen:/subgen volume. If that's used, you'll manually have to drop subgen.py in that folder. If you remove it, it'll work fine and just run from the docker file system. Ultimately plex returns a webhook like Played file at: E:/Data/media/tvshow.mkv and subgen needs to be able to access that exact path. ---------------------------------------------------------------------- viceman256 · 2023-10-26 19:13 Awesome thanks again for your time and effort. That explains the pieces I wasn't understanding from the formatting. I'll play with it again tonight! ---------------------------------------------------------------------- TheJambo · 2023-10-26 19:55 Fuck yeah man lets go ---------------------------------------------------------------------- Kaikidan · 2023-10-26 21:34 One last thing i noticed, but not something big, english translated srts get named[filename].subgen.medium.aa.srt instead of [filename].srt, and so plex can't automatically detect them, besides that, the generated srts works very nice and translation is good. ---------------------------------------------------------------------- UntouchedWagons · 2023-10-26 22:17 Sweet. Can I use CUDA standalone or do I have to build the CUDA container? ---------------------------------------------------------------------- McCloud · 2023-10-26 23:01 Plex detects all of mine and even selects them by default is there is no other. ---------------------------------------------------------------------- McCloud · 2023-10-26 23:12 As long as you install the dependencies as listed on the faster- whisper page, you could just run the script without the docker. ---------------------------------------------------------------------- [deleted] · 2023-10-27 03:50 [deleted] ---------------------------------------------------------------------- McCloud · 2023-10-27 03:50 My Tesla T4 ran a 21 minute file in 4 minutes. ---------------------------------------------------------------------- Adam_Meshnet · 2023-10-27 08:53 Can we assume that live transcription is possible according to this then? I mean, my bird brain tells me it is, but I am not sure if there is some reason it might not be feasible. ---------------------------------------------------------------------- AshipaEko · 2023-10-27 12:32 >127.0.0.1:8090/jellyfin Looks like it now works? Thanks `Oct 27 12:14:06 jf-two python3[130770]: DEBUG:root:Raw response: b'{"ServerId":"b0a44ae3924944bbbfaadc5a2aba75a5","ServerName":"jf-two" ,"ServerVersion":"10.8.11","ServerUrl":"https://media.ashipaek0.websit >` `Oct 27 12:14:06 jf-two python3[130770]: DEBUG:root:Event detected is: PlaybackStart` `Oct 27 12:14:06 jf-two python3[130770]: DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:8096` `Oct 27 12:14:06 jf-two python3[130770]: DEBUG:urllib3.connectionpool:http://127.0.0.1:8096 "GET /Users HTTP/1.1" 200 None` `Oct 27 12:14:06 jf-two python3[130770]: DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:8096` `Oct 27 12:14:06 jf-two python3[130770]: DEBUG:urllib3.connectionpool:http://127.0.0.1:8096 "GET /Users/da6fe85 517d84400b0d7c5ebe76d014b/Items/da3a8d241435c241354f4ba6b212d939 HTTP/1.1" 200 None` `Oct 27 12:14:06 jf-two python3[130770]: DEBUG:root:Path of file: /media/gdrive/TV/Billions (2016)/Season 7/Billions.S07E12.REPACK.720p.WEB.x265-MiNX[TGx].mkv` `Oct 27 12:14:09 jf-two python3[130770]: DEBUG:root:Subtitles in 'eng' language found in the video.` `Oct 27 12:14:09 jf-two python3[130770]: DEBUG:root:File already has an internal sub we want, skipping generation` `Oct 27 12:14:09 jf-two python3[130770]: INFO:werkzeug:127.0.0.1 - - [27/Oct/2023 12:14:09] "POST /jellyfin HTTP/1.1" 200 -` ---------------------------------------------------------------------- McCloud · 2023-10-27 12:46 Appears to be. The last check is to actually have it transcribe. ---------------------------------------------------------------------- McCloud · 2023-10-27 12:48 Whisper has the capability to do live transcription/translation. This does not since the file has to be reloaded once it’s created. I can’t stream partial subtitles into a media file. ---------------------------------------------------------------------- McCloud · 2023-10-31 07:31 Completed the Bazarr integration. See: https://github.com/McCloudS/subgen/edit/main/README.md#bazarr ---------------------------------------------------------------------- McCloud · 2023-10-31 07:31 Just added this: see https://github.com/McCloudS/subgen/edit/main/README.md#bazarr ---------------------------------------------------------------------- nullx · 2023-10-31 12:45 Awesome, that was fast! I'll definitely be checking it out, thank you! ---------------------------------------------------------------------- McCloud · 2023-11-01 00:55 Bazarr support is added, see the repo on how to add it as a provider. ---------------------------------------------------------------------- fefeh1 · 2023-11-18 22:13 I have a suggestion. I have installed it and it seems to be working, but I don't know which file it is working on at the time. I look at the logs and I can see where it is determining the language and translating and transcribing, but I have no idea which movie/show it is processing. Thanks for the great app! ---------------------------------------------------------------------- McCloud · 2023-11-19 02:53 Unfortunately stable-ts and whisper don’t obviously output which files it is working on, so you’re dependent on trying to decipher it from the logs. I tried to add prints to show which files it has queued and started, but with threading, the std-out sometimes gets lost or buffered in strange ways. ---------------------------------------------------------------------- fefeh1 · 2023-11-19 02:54 Ok. Thanks for letting me know. ---------------------------------------------------------------------- sanno64 · 2023-12-04 06:14 Man you are awesome! Tysm!