McCloudS / subgen

Autogenerate subtitles using OpenAI Whisper Model via Jellyfin, Plex, Emby, Tautulli, or Bazarr
MIT License
453 stars 45 forks source link

Still no cigar :( #86

Closed sdspieg closed 2 months ago

sdspieg commented 3 months ago

I'm giving this another try.

And yet I don't get any subtitles. Hence these questions:

Thanks much for you efforts!

McCloudS commented 3 months ago

Is your plex token set and are you adding media to the library? You have on play disabled, which is probably the log parts you’re seeing. You only have onadded enabled, meaning media has to be added to your library to trigger a generation.

McCloudS commented 3 months ago

A sequence of events:

  1. Plex sends to subgen that something was played or added to the library (This is the /plex 200 OKs you're seeing)
  2. Subgen receives it, sends something back to Plex to get the file path (this is why the Plex Token is needed) and determines based off of subgen settings (primarily PROCADDEDMEDIA PROCMEDIAONPLAY SKIPIFINTERNALSUBLANG) to determine if it needs to generate subtitles. If it doesn't need to run, the process ends here and it waits for step 1 again.
  3. Subgen runs, and assuming you have the same docker paths mounted between Plex/Subgen, it will place a subtitle next to the file loosely named mediafile.subgen.{whisper_model}.{namesublang}.srt
  4. You select the external subtitle under playback settings.

I'm guessing in your case that you are only playing files and not adding new media to trigger PROCADDEDMEDIA because you have PROCMEDIAONPLAY set to False.

Setting DEBUG to True will produce a little more output that can be helpful troubleshooting.

sdspieg commented 3 months ago

Is your plex token set

Yes.

are you adding media to the library

No. I'm (so far) just playing existing media.

You only have onadded enabled, meaning media has to be added to your library to trigger a generation.

Ok - I'll look into that. But where do I find that? [UPD - I DID find that]

A sequence of events

That's EXTREMELY useful - thanks much for sharing that! But so I now have image and image Is that ok?

assuming you have the same docker paths mounted between Plex/Subgen

How do I makes sure that's the case? I THINK I did that correctly (I looked in my Docker Desktop Image 'Bindings' under network and saw this

        "Networks": {
            "subgen_default": {
                "IPAMConfig": null,
                "Links": null,
                "Aliases": [
                    "cb7b403b0416",
                    "subgen"
                ],
                "NetworkID": "95662124969bcae12b3d1838c80f42833ec6e6ac05c2233cf625607984aceb71",
                "EndpointID": "1523e2c6a94dece1eca9a7174db354e06ba090aa65b49e2f6c80ef4aa3426fc3",
                "Gateway": "172.20.0.1",
                "IPAddress": "172.20.0.2",

But maybe that's not ok...

Setting DEBUG to True will produce a little more output that can be helpful troubleshooting.

I did set it... But I did notice it doesn't seem to work. Should I restart sthg to make that work?

But so just for my understanding: if everything is set up correctly, should ANY non-English item just immediately start showing translated subtitles? Is that what you have?

McCloudS commented 3 months ago

Yup, you'll want both of those true. So it will process subtitles for any new media added and anything that is played. The issue with the played is you will be waiting X minutes (for the transcription to finish) before it's ready. Which is fine my use-case because my GPU cranks them out in a couple minutes, so we just turn the subtitle on a couple minutes into a show if we need to.

Sorry, by Docker paths, I meant your volumes. So my personal setup on Plex AND Subgen have the following mounted as volumes: image

I have both PROCADDEDMEDIA and PROCMEDIAONPLAY set to true and SKIPIFINTERNALSUBLANG to eng. SKIPIFINTERNALSUBLANG is there if you want it, so I don't waste time generating subtitles that already have internal english ones (or whatever you set) in the file.

I think you're pretty close to a working solution.

sdspieg commented 3 months ago

I think you're pretty close to a working solution.

Sounds great! (Theoretically!)

my GPU cranks them out in a couple minutes, so we just turn the subtitle on a couple minutes into a show if we need to.

So I have an RTX-4090, AND I have CUDA installed etc. So it seems to me this SHOULD be working just fine! (it just doesn't - yet..)

So my personal setup on Plex AND Subgen have the following mounted as volumes:

Here's what I have in my 'docker-compose.yml' for this - these are all my (wsl) folders that have content. Is there anything wrong with this part?

    volumes:
      - "/mnt/c/Plex/subgen/subgen:/subgen"
      - "/mnt/c/Plex/whisper:/whisper"
      - "/mnt/c/Plex/Movies:/media/Movies"
      - "/mnt/c/Plex/Russian movies:/media/Russian movies"
      - "/mnt/h/Plex/Movies:/media/Movies2"
      - "/mnt/h/Plex/TVShows:/media/TVShows"
      - "/mnt/h/Plex/Russian movies:/media/Russian movies2"
      - "/mnt/i/Plex/Audiobooks:/media/Audiobooks"
      - "/mnt/i/Plex/Downloads:/media/Downloads"
      - "/mnt/i/Plex/Library:/media/Library"
      - "/mnt/i/Plex/Movies:/media/Movies3"
      - "/mnt/i/Plex/temp:/media/temp"
      - "/mnt/i/Plex/TVShows:/media/TVShows2"

I also have set SKIPIFINTERNALSUBLANG to eng... Can't wait to get this fully working!!! And thanks for your patient support...

McCloudS commented 3 months ago

If those volumes are shared across the containers, that should be correct.