-
Notifications
You must be signed in to change notification settings - Fork 14
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
Some files aren't generating thumbnails, FFMPEG error -22 #61
Comments
Hi @breath-prime , I'm not sure why this is happening. We will need debug logs tho. Can you set env var LOG_LEVEL=debug and rerun and then share the logs here? In the meantime, I've got some questions.
Thanks |
Hi @stevezau, Sure thing. LOG_LEVEL=debug was already set. Is there a specific location to pull the log files from outside of what's generated in the console? I'm afraid I'm not seeing that location in the documentation unless I'm just blind.
I just cleared one of my library thumbnails and I'm regenerating them now. Will update with some more console output soon. Thanks for your time/help! |
I already found one thing I need to change: I set TMP_FOLDER to a unique folder instead of leaving it in /dev/shm/XXXXX or assigning a tmpfs volume. For now I'm leaving it as is, unless you recommend otherwise. I'm fairly new to docker setups so sorry for any starter mistakes here. I've attached some console output here with some of the errors. |
I just noticed some interesting, intermittent behavior. In my original post, I listed one example error on a library file. This time around, it generated the thumbnails correctly on the same file, while others are having issues. |
I know what this might be. Can you tell me the version of FFMPEG please?
|
Hi @planetrocky, Looks like version 7.0.1 in the container: Thank you! |
Hmm, looking at the logs, it works for some files but not others. That’s odd—I’m not sure what’s going on. @breath-prime, do you think this could be a known issue with 7.0.1? I’ve locked it to 7.0.1 for now, but I can upgrade if needed. Also, I see you changed the tmp path. Does it consistently fail on the same files? By the way, are you familiar with Docker? I might ask you to jump into the container and run ffmpeg manually to check the debug output. So first start the container but drop into a shell command Then within the container run the below which failed in your previous run. |
In all my experience (months of testing), FFMPEG will terminate very quickly and you will see the exact error you have. I actually thought I had a bug in my code for a very long time! This is a crash internally in the FFMPEG HEVC packet processor. For example, using this build of Extracting the errors from FFMPEG log, will yield this at the very start of the file. [vist#0:0/hevc @ 00000278013f9640] [dec:hevc @ 00000278013f08c0] Error processing packet in decoder: File exists
[vist#0:0/hevc @ 00000278013f9640] [dec:hevc @ 00000278013f08c0] Task finished with error code: -17 (File exists)
[vist#0:0/hevc @ 00000278013f9640] [dec:hevc @ 00000278013f08c0] Terminating thread with return code -17 (File exists)
[vost#0:0/mjpeg @ 00000278061a3180] [enc:mjpeg @ 0000027810c91a00] Could not open encoder before EOF
[vost#0:0/mjpeg @ 00000278061a3180] Task finished with error code: -22 (Invalid argument)
[vost#0:0/mjpeg @ 00000278061a3180] Terminating thread with return code -22 (Invalid argument)
[out#0/image2 @ 00000278050954c0] Nothing was written into output file, because at least one of its streams received no packets. |
FFMPEG VersionIt does depend upon the CODEC and container that is causing FFMPEG to terminate. I've a broad range of test-material, and have found different bugs across a range of different FFMPEG versions. Please try ffmpeg version 7.1 (some of my test cases succeed in 7.01, but not all) However don't try any nightly builds from January 2025 onwards, as they will fail a lot on HEVC video. Last known good nightly build of FFMPEGThe last known good version I have is: ffmpeg-2025-01-08-git-251de1791e.exe -version
ffmpeg version 2025-01-08-git-251de1791e-full_build-www.gyan.dev Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-lcms2 --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3 --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 59. 54.101 / 59. 54.101
libavcodec 61. 31.100 / 61. 31.100
libavformat 61. 9.104 / 61. 9.104
libavdevice 61. 4.100 / 61. 4.100
libavfilter 10. 6.101 / 10. 6.101
libswscale 8. 13.100 / 8. 13.100
libswresample 5. 4.100 / 5. 4.100
libpostproc 58. 4.100 / 58. 4.100 |
Hi,
Thank you for the time you and everyone have spent creating and supporting this script.
Current Issue:
I'm currently rebuilding my thumbnails after a fresh rebuild of plex. When I let the script run, some files error out with a -22 error from FFMPEG. When this occurs, no thumbnails are generated and plex just shows black thumbnails for the affected file. It also does not seem to retry with the files so I'd have to delete all thumbnails and try regenerating the whole library again.
Environment:
Example Error:
2025/02/13 18:15:54 | ❌ - [' Terminating thread with return code -22 (Invalid argument)', ' Nothing was written into output file, because at least one of its streams received no packets.', 'frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A ', 'Conversion failed!', ''] 2025/02/13 18:15:54 | ❌ - Problem trying to ffmpeg images for /media/Anime/Aoashi/Season 1/Aoashi - S01E20 - The Truly Weak One.mkv 2025/02/13 18:15:54 | 🐞 - FFMPEG Command output 2025/02/13 18:15:54 | 🐞 - b'' 2025/02/13 18:15:54 | ℹ️ - Generated Video Preview for /media/Anime/Aoashi/Season 1/Aoashi - S01E20 - The Truly Weak One.mkv HW=False TIME=1.4seconds SPEED=[]x
I've attached a sanitized docker compose file, and would appreciate any help with this. I can provide any other logs or output you may need.
Thank you!
plex_stack_compose.txt
The text was updated successfully, but these errors were encountered: