Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub does not gen in Jellyfin #159

Closed
Zenkiwu opened this issue Dec 26, 2024 · 9 comments
Closed

Sub does not gen in Jellyfin #159

Zenkiwu opened this issue Dec 26, 2024 · 9 comments

Comments

@Zenkiwu
Copy link

Zenkiwu commented Dec 26, 2024

Hi , I just build the container via Docker-compose, however it does not generate any sub in Jellyfin when a movie was played. It is appreicated if you could help to check what is going on. below are the configure from my end. Thanks in advance.

version: "3"
services:
subgen:
container_name: subgen
tty: true
image: mccloud/subgen
network_mode: host
environment:
- "WHISPER_MODEL=small" #实测cpu使用medium即可,如果性能不够可以试试small
- "WHISPER_THREADS=1" #并发线程数
- "PROCADDEDMEDIA=True" #是否在jellyfin新增媒体时触发
- "PROCMEDIAONPLAY=True" #是否在jellyfin媒体播放时触发
- "NAMESUBLANG=chi" #需要生成的字幕文件语言后缀
- "SKIPIFINTERNALSUBLANG=chi" #是否跳过已有中文字幕的视频
- "SKIPIFEXTERNALSUB=True" #是否跳过带内嵌字幕的视频
- "SKIP_IF_AUDIO_TRACK_IS=chi" #跳过中文音频的视频
- "JELLYFINTOKEN=xxxxxxxxxxx"
- "JELLYFINSERVER=http://192.168.1.10:8096" #你的Jellyfin地址,同个容器网络填写容器名+端口
- "WEBHOOKPORT=9000" #服务端口
- "CONCURRENT_TRANSCRIPTIONS=2" #同时转录的视频数
- "WORD_LEVEL_HIGHLIGHT=False" #没啥用
- "DEBUG=True" #开启DEBUG日志,实测无效要改源码
- "USE_PATH_MAPPING=True" #开启重映射
- "FORCE_DETECTED_LANGUAGE_TO=chi" #强制指定转录语言
- "TRANSCRIBE_OR_TRANSLATE=TRANSCRIBE" #transcribe可以实现英文转中文
- "TRANSCRIBE_DEVICE=cpu" #使用硬件,有独显可以换成gpu
- "CLEAR_VRAM_ON_COMPLETE=True" #开启垃圾收集
- "MODEL_PATH=/subgen/models" #模型保存路径,对应下面的映射
- "UPDATE=True" #是否自动从git库更新程序,一些最新更改可能没在docker镜像中,比如最近我刚建议大佬开放的vad参数,也可以自己指定
- "APPEND=False" #在字幕结尾添加whisper文案
- "USE_MODEL_PROMPT=True" #使用自定义提示词
- "CUSTOM_MODEL_PROMPT=你好,欢迎来到我的讲座。" #自定义提示词,如果你懂提示词优化的话
- "LRC_FOR_AUDIO_FILES=True" #支持歌曲LRC歌词文件生成
- "CUSTOM_REGROUP=cm_sl=84_sl=42++++++1" #不懂,应该是优化字幕格式的
- "SUBGEN_KWARGS={'vad': True,'prefix': '对,没错,继续。'}" #通过vad避免幻听和提示前缀避免变回英文
volumes:
- /volume1/Media/Movie:/Movie #映射目录路径要保持一致(/media:/media),否则需要配置重映射
- /volume1/Media/TV:/TV
- /volume1/Media/ACG:/ACG
- /volume1/Media/Others:/Others
- /volume1/docker/subgen/models:/subgen/models #模型目录
#- ${CONFIG_PATH}/subgen/subgen.py:/subgen/subgen.py #如果你要修改程序则指定路径
ports:
- 9000:9000

below is the log from the docker

==========
== CUDA ==

CUDA Version 12.3.2

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

WARNING: The NVIDIA Driver was not detected. GPU functionality will not be available.
Use the NVIDIA Container Toolkit to start this container with GPU support; see
https://docs.nvidia.com/datacenter/cloud-native/ .

subgen.env file not found. Please run prompt_and_save_env_variables() first.
Downloading subgen.py from GitHub branch main...
URL Error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'raw.githubusercontent.com'. (_ssl.c:1007)
URL Error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'raw.githubusercontent.com'. (_ssl.c:1007)
Launching subgen.py
2024-12-26 03:58:56,491 INFO: Subgen v2024.12.7
2024-12-26 03:58:56,491 INFO: Starting Subgen with listening webhooks!
2024-12-26 03:58:56,491 INFO: Transcriptions are limited to running 2 at a time
2024-12-26 03:58:56,492 INFO: Running 1 threads per transcription
2024-12-26 03:58:56,492 INFO: Using cpu to encode
2024-12-26 03:58:56,493 INFO: Using faster-whisper
INFO: Started server process [26]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
INFO: 127.0.0.1:58250 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:58250 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:58250 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:58250 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:58262 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:58316 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:58316 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:58316 - "POST / HTTP/1.1" 405 Method Not Allowed
INFO: 192.168.1.10:35058 - "POST / HTTP/1.1" 405 Method Not Allowed
2024-12-26 06:30:21,173 DEBUG: Jellyfin event detected is: PlaybackStart
2024-12-26 06:30:21,174 DEBUG: itemid is: 1feb2790e1e0600236f251bad7420b1c
2024-12-26 06:30:21,365 DEBUG: Path of file: /volume1/Media/Others/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv
2024-12-26 06:30:21,365 DEBUG: Updated path: /volume1/Media/Others/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv
2024-12-26 06:30:21,366 WARNING: /volume1/Media/Others/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv is neither a file nor a directory. Are your volumes correct?
2024-12-26 06:30:21,400 INFO: Metadata refresh queued successfully.
2024-12-26 06:30:21,402 INFO: Metadata for item 1feb2790e1e0600236f251bad7420b1c refreshed successfully.
INFO: 192.168.1.10:38052 - "POST /jellyfin HTTP/1.1" 200 OK
root@NAS1202:~#

@McCloudS
Copy link
Owner

McCloudS commented Dec 26, 2024

What do your jellyfin volumes look like? You probably don’t need USE_PATH_MAPPING since you can do the same thing by using docker volumes/mapping.

The error implies subgen can’t see the file, which makes me think your subgen and jellyfin mappings don’t match.

@Zenkiwu
Copy link
Author

Zenkiwu commented Dec 26, 2024

{84517ADE-34B0-40C3-B48D-3C12B04A538F}
{0BFF8B44-E7BD-43DA-85DE-74054DDD0FED}
{7AF366B1-A36A-408F-872A-4C98D5174636}
{4CA27329-A7BF-4137-92A3-85C3854B8B92}
Please refer to the aboved , I just disabled the mapping but the issue persists.
BTW, where will the substitle be present if I close the built-in substitle for the Movie, thanks.

@McCloudS
Copy link
Owner

Im not sure what that picture is. What are your volume mappings for your Jelllyfin docker?

Your error is subgen not seeing the file based off of the path Jellyfin gave it. If you’re in the Jellyfin container, can you navigate to your file with that path and see it?

The subtitles will be in the same place you pick subtitles in jellyfin. You may need to set namesublang to zh if Jellyfin doesn’t accept a subtitle with a 3 letter language code.

@Zenkiwu
Copy link
Author

Zenkiwu commented Dec 27, 2024

Actually Jellyfin is not installed in docker but standalone.
Below is the path mapping in Jellyfin for each media folder
{9ECA8A3D-1890-463D-974F-DAB696C7BF9B}
I am thinking if there is something wrong on the volume mapping in subgen docker compose file, would you please do favor to explain more in details how to map the patch, for example ,in this case the physical path for the movie folder(in Jellypin) is /volume1/Media/Movie, what is the path would be in subgen container?

@muisje
Copy link
Contributor

muisje commented Dec 27, 2024

Should be like this in your docker compose then of subgen:

volumes:
- "/volume1/Media:/volume1/Media"

And set USE_PATH_MAPPING=False

@muisje
Copy link
Contributor

muisje commented Dec 27, 2024

Btw are you running it on the same device? If not you would need to remote mount the folder. I did it myself with sshfs.

@Zenkiwu
Copy link
Author

Zenkiwu commented Dec 27, 2024

Jellypin and subgen are running in the same NAS, subgen in the docker while Jellypin out of docker

@muisje
Copy link
Contributor

muisje commented Dec 27, 2024

Okay then, should work if you try my suggestion in the comment before

@Zenkiwu
Copy link
Author

Zenkiwu commented Dec 27, 2024

It looks still have someting wrong as below and I dont find the subtitles presenting. How do I know if it works or not?
2024-12-27 02:57:58,219 DEBUG: Path of file: /volume1/Media/Others/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv
2024-12-27 02:57:58,445 DEBUG: choose_transcribe_language(/volume1/Media/Others/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv, Unknown)
2024-12-27 02:57:58,446 DEBUG: ENV FORCE_DETECTED_LANGUAGE_TO is set: Forcing detected language to Chinese
2024-12-27 02:57:58,489 ERROR: An error occurred while checking the file with pyav:
2024-12-27 02:57:58,540 ERROR: An error occurred while checking the file with pyav:
2024-12-27 02:57:58,581 ERROR: An error occurred while checking the file with pyav:
2024-12-27 02:57:59,378 INFO: task_queue.put(task)(/volume1/Media/Others/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv, TRANSCRIBE, Chinese)
2024-12-27 02:57:59,379 INFO: Task /volume1/Media/Others/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ/Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv is being handled by Subgen.
2024-12-27 02:57:59,389 INFO: Added Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv for transcription.
2024-12-27 02:57:59,391 INFO: Transcribing file: Harry.Potter.20th.Anniversary.Return.to.Hogwarts.2022.2160p.WEB-DL.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ.mkv
2024-12-27 02:57:59,391 INFO: Transcribing file language: Chinese
2024-12-27 02:57:59,391 DEBUG: Model was purged, need to re-create
2024-12-27 02:57:59,413 INFO: Metadata refresh queued successfully.
2024-12-27 02:57:59,414 INFO: Metadata for item 1feb2790e1e0600236f251bad7420b1c refreshed successfully.
INFO: 192.168.1.10:43782 - "POST /jellyfin HTTP/1.1" 200 OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants