Server Version#:1.40.0.7775-456fbaf97
Player Version#:
You would think that a massive scanning event, like adding a new folder, or new content TO a folder, would really benefit from GPU offload, especially for those running GPU’s allowing multiple processes at a time. But it appears that the scanner uses CPU only, in spite of playback transcoding working perfectly.
The transcoder (CPU) must read through the file and find the information.
If you have Chapter Thumbnails on (enabled by default) and Chapter Indexes (enabled by default), and Credit / Intro detection, it must read the file, grab the frames / time stamps, and write them to the DB.
The GPU is not capable of writing to the DB on its own. It lives in its OpenCL world.
It’s a background task anyway. If you look at the process priority, you’ll find it’s been 'nice’d lower.
For the scanner, I suppose that makes sense. You’re saying there’s no “GPU_Enabled” code written into the scanner process.
However, for the transcoder, I’m slightly puzzled…the “GPU-enabled-transcoder-process” isn’t enabled for Database writes, but the “CPU-Enabled-transcoder-process” is?
Because to watch transcoded content, both are taking a FILE as input, and generating a FILE/STREAM as output, What am I missing here?
So, wouldn’t the speed of the Media Scanner increase by doing this:
CPU reads a raw video block from the file
Hands that raw video block to the GPU
GPU decodes the block, and via memory, hands the “raw” block back to the CPU for analysis.
My point is, there’s a pretty significant hit from the more complex encoding methods. The GPU is far faster at decoding H.264/H.265/VP1/AV1 frames than the CPU, to build chapter thumbnails, or for Credit/Intro detection, right?
Understood - which is why, just like the “Hardware Encode/Decode” toggles that exist right now to allow GPU’s to be used… Add another one for “Hardware Accelerated Media Scanning” - then trust the users to figure out if they can use it or not.
Judging from most of the GPU discussion I see on these forums, running GPU’s that can handle multiple transcodes at the same time is pretty common. Make it a lower priority task, but in theory, they should be able to co-exist, right? (a little bit like sharing the CPU)
Not being the developer, I’m asking an honest question – if Media Scanning will take 100% of all available cores with FFMPEG processes when it runs, wouldn’t GPU offloading help? If it would, consider this a feature request.
If you look at this a a “type of task”, Scanning is generalized and Playback is specialized.
Scanning requires
– Read the file headers to see what’s in it
– Perform basic analysis of those streams (video, audio, and subtitles)
– Talk to the databases
– Talk to the media servers to download posters & metadata
Playback requires
– Convert the source video to a specific format & bitrate needed for the player
– Convert audio (possibly) to a specific format needed for the player
The biggest load here for scanning is the generalized analysis because we don’t know what we’re going to get. Trying to put all of FFMPEG in a GPU just for analysis isn’t practical. GPU code is difficult to develop.
The biggest load during playback is the video. Converting audio is trivial on a CPU.
When you have to decide where the load is best distributed,
Video is best done in the GPU because most video formats are hard (computationally) to convert. GPUs , because of their base design, are best suited for the task. We want that acceleration.
Audio conversion is , by comparison, trivial if needed at all.
All the database work and all the internet server communication doesn’t make sense to put in a GPU because it would need the CPU anyway to do the disk & network I/O so it was decided to just leave it there.
I am very curious what’s prompting this?
You show a screenshot of a 12 core CPU which is getting hit pretty heavily (scanning media?)
Media ingestion is a one-time task. Media playback (with transcode) will occur many times,
Which CPU are you using? Which distro and version are you using?
I’m very curious about the CPU you have because even with my machines, they don’t get hit that hard when I’m ingesting new media. I do see the CPU load spike up to 80+ % (on the little NAS boxes) load for the 10-15 minutes while it’s ingesting a 500+ movie library but then it’s done.
I’d switch all analysis and thumbnailing tasks to “scheduled” only, not “when media is added”.
The high load you’re seeing is probably caused this analysis and not by the library scan as such. https://support.plex.tv/articles/200289526-library/
this box has 2x16-core opterons in it. 12 cores are allocated to the plex KVM instance, for three reasons. (1) media scanning, (2) chapter generation, (3) when GPU transcoding fails for specific fall-through types of media or endpoints.
Due to a bug with new content not being added, even after scans, i’ve had to delete and re-add several large folders, and was bemused to see all cores flatlined for an extended period of time, and the GPU was idle.
Absolutely not suggesting you write GPU-code for the disk-IO/network-IO - I was assuming that you’re using a version of FFMPEG (aka Plex Transcoder) for the chapter/scanning tasks that is intentionally NOT using hw decode flags, and was wondering why.