stevezau / plex_generate_vid_previews

Speed up the process of generating preview thumbnails for your Plex media library.
66 stars 12 forks source link

Terminating thread with return code -28 (No space left on device) #42

Closed espentruls closed 2 months ago

espentruls commented 2 months ago

Terminating thread with return code -28 (No space left on device)

I get this error message when it tries to do 4k dovi/hdr full Blu-ray remuxes or the encoded equivalent. This script works flawlessly with tv shows but errors out when the file size and/or format gets too big or complicated.

stevezau commented 2 months ago

@espentruls, can you paste the output?

The error suggests you ran out of space.... Is that the issue? or are you suggesting something else is wrong?

espentruls commented 2 months ago

@stevezau I have 44.9TB left of free storage. So there is something else happening here. It tells me that error and then does fine on 10-15 shows. and then errors again on the same run. so it has nothing to do with storage space. maybe its something to do with how plex manages it. when i put it the interval to 2 it error on every episode, now at 5 it only error on larger files and complex files with dovi/hdr

espentruls commented 2 months ago

It looks like it was a mapping issue. I mapped the PLEX_LOCAL_MEDIA_PATH volume as R/WS https://docs.docker.com/storage/bind-mounts/#configure-bind-propagation

I thought mounting a folder that is mounted inside the plex docker would mess up the plex docker like it did on others i have tried with. But mounting the volume as R/W doesnt mess up the plex container. It still has access to the folder.

stevezau commented 2 months ago

@espentruls ok great, so all resolved?

espentruls commented 2 months ago

@stevezau I'm running it now. I'm gonna go delete a few thumbnails that I know failed last time and then report back to you by tomorrow. Just in case

espentruls commented 2 months ago

@stevezau Suddenly I got another problem. It's been working for hours and when it got to House of the Dragon i got this error

2024/07/24 13:27:55 | ❌  - ['  Hardware device setup failed for decoder: 
Generic error in an external library', ' Error initializing a simple 
filtergraph', 'Error opening output file 
/dev/shm/plex_generate_previews/1fd0bdc7643fb609c41f05eb31bbf4f6378cda70/img-%06
d.jpg.', 'Error opening output files: Generic error in an external library', '']

Looks like its got something to do with my 1050ti. But shouldn't this just let the cpu do it instead of failing it? Or maybe it has something to do with video memory. Maybe I should reduce my gpu threads to 1 or 2 to try it out?

espentruls commented 2 months ago

Im noticing now that it happens to every new tv show that is in dolby vision with/or without hdr 10 fallback.

stevezau commented 2 months ago

Hi, @espentruls, how are you mounting the folders in your container? Specifically how are you setting the TMP_FOLDER variable? And, what memory was assigned to the container?

It uses /dev/shm/plex_generate_previews by default.. Which is using ram.. I wonder if that's running out of space due to the size of DV+HDR

stevezau commented 2 months ago

How did you go @espentruls ?

espentruls commented 2 months ago

@stevezau Sorry for the late reply. I haven't set an option for TMP_Folder so that explains it. Im probably running out of ram. I only have 60GB. I will try to map it to my NVME drive and see if that fixes the problem

stevezau commented 2 months ago

No worries. LMK how you go.

espentruls commented 2 months ago

I still get errors after remapping @stevezau

2024/07/26 11:18:26 | ❌  - ['  Hardware device setup failed for decoder: 
Generic error in an external library', ' Error initializing a simple 
filtergraph', 'Error opening output file 
/data/pgvp/8432c84d675cf0b48db54ecf91a88b6faf12d0b7/img-%06d.jpg.', 'Error 
opening output files: Generic error in an external library', '']
2024/07/26 11:18:26 | ❌  - Problem trying to ffmpeg images for 
/data/media/tv/Severance (2022) {imdb-tt11280740}/Season 01/Severance (2022) - 
S01E01 - Good News About Hell [ATVP WEBDL-2160p][DV HDR10Plus][EAC3 Atmos 
5.1][HEVC]-HONE.mkv
2024/07/26 11:18:26 | ℹ️  - Generated Video Preview for /data/media/tv/Severance
(2022) {imdb-tt11280740}/Season 01/Severance (2022) - S01E01 - Good News About 
Hell [ATVP WEBDL-2160p][DV HDR10Plus][EAC3 Atmos 5.1][HEVC]-HONE.mkv HW=True 
TIME=1.2seconds SPEED=[]x 
espentruls commented 2 months ago

This is my full setup.

docker run
  -d
  --name='plex_generate_vid_previews'
  --net='vision'
  -e TZ="Europe/Berlin"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="VISION"
  -e HOST_CONTAINERNAME="plex_generate_vid_previews"
  -e 'PLEX_URL'='http://192.168.1.147:32400'
  -e 'PLEX_TOKEN'='<REDACTED>'
  -e 'PLEX_BIF_FRAME_INTERVAL'='5'
  -e 'PLEX_LOCAL_MEDIA_PATH'='/media'
  -e 'THUMBNAIL_QUALITY'='4'
  -e 'GPU_THREADS'='4'
  -e 'CPU_THREADS'='4'
  -e 'NVIDIA_VISIBLE_DEVICES'='GPU-628807a8-0de4-30a3-89e5-e57a1c83bd06'
  -e 'NVIDIA_DRIVER_CAPABILITIES'='all'
  -e 'TMP_FOLDER'='/data/pgvp'
  -l net.unraid.docker.managed=dockerman
  -v '/mnt/user/data':'/data':'rw'
  -v '/mnt/system_cache/appdata/plex/Library/Application Support/Plex Media Server/Media':'/media':'rw'
  --runtime=nvidia 'stevezzau/plex_generate_vid_previews'
espentruls commented 2 months ago

I'm trying to reduce GPU threads and increase CPU threads to what i have set-up in tdarr. Maybe that'll fix it

-e 'GPU_THREADS'='3' -e 'CPU_THREADS'='6'

espentruls commented 2 months ago

@stevezau I can see all threads in nvtop even the cpu ones. It looks to be running fine now when i reduced the amount of threads. It looks to still be using a lot of ram, so it has nothing to do with the tmp location. That uses only a few MB.

stevezau commented 2 months ago

Hey @espentruls ah ok. so perhaps the card was running out of memory?

Anyway, looks like it is resolved now? I can close this?

stevezau commented 2 months ago

@espentruls i will close this now, if this is in error please let me know.