Hey guys, I have a few transcoding questions again. This is not a “please help my stuttering movie”, it is more a “how does transcoding work on a high level” typ of post.
I’m doing my tests with Jumanji (info attached) cause it really punishes my Skull Canyon NUC. It has a passmark of 9.7k but I would like to say that it is completely irrelevant for my question. My question would still apply if I was on a 2k passmark system trying to transcode 4k to 4k.
PMS is running on Ubuntu 17.10. I’m playing it in a LAN through Plex web client. In the player I’ve selected for it to “convert to maximum”, 4k 53.2 Mbps, which pretty much results in a HVEC to H264 conversion. I’m using the fast transcoder profile in the server (I’ve been using auto but switched it for testing) and the throttle is on 60 secs. Subs are not on. I’m getting stutters at the same point in the file whenever I start it with the same transcoder settings.
Now that this punishes my NUC (pretty much 92%+ CPU constant) since it requires transcoding such a high bit rate file is not all that strange, especially since it is going from HVEC to H264. I think that should be expected. What I do not understand how ever is why the transcoder behaves like it does.
To me it feels like that when ever the transcoder start hitting the CPU limit for a period of time the playback stutters or frames are dropped, no matter if I’ve paused to let it fill the buffer. Now…this might sound strange (that I think it sounds strange…) but this really doesn’t make sense to me and this is what I would like to understand a bit better.
What I would expect (but I am obviously wrong somehow) is that when the transcoder hits the CPU limit, It would not have time to fill the buffer or to stream the data to the client. This means that (for example) if it takes 10 secs to produce a 5 sec transcoded video, one will obviously have buffering issues. Not strange at all. I would at that point also expect that since it cant keep up, I should be able to press pause, let it work at the pace it “can deal” while the buffer fills, then play a stutter free movie as long as it still is buffered. I would never expect the transcoder to produce a result that stutters, drop frames and buffers.
What I am seeing, and not understanding, is that to me it seems like when the CPU hits 100% it actually starts doing a bad job and producing bad transcoded results. In other words I get the feeling that if your CPU is peaking you will always see bad results in regards to stutter and buffering/waiting issues no matter how long you let the server work before playing/using the data. This seems to me that you can never buffer or throttle a movie that requires transcoding if your CPU cant transcode the movie in real time, no matter if you actually need (read movie is paused) the transcoding results in real time. It seems that throttling or buffering has lost its purpose here. If a movie has been paused, there is no reason to produce bad transcoding results on data we dont yet need, we can allow that data to be transcoded at what ever rate it takes until we press play. Then we can play our little perfect data until we are out of a “transcoded” buffer.
So yeah, I have no clue why I am always seeing stuttering and buffering/waiting at that point in the movie even if i have a HUGE throttling value (for test) and when I let the transcoder work a good while before playing the actual portion of the movie containing the problem. To me with a little bit of black box thinking it seems like the transcoder is always on some kind of real time algo, resulting in frames being dropped, stutters and buffer wait time issues no matter if you actually let the transcoder work(/gave it time) before you play the movie.
I would like to say that I have a decent computer background and that I’ve been working with software development for a few years, that is mostly the reason to my question and why I cant actually understand it. I am by no means super good, but from what I know about software development, I’m having a hard time understanding the transcoding code/logics/algos. I have a few theories of why this would be happening but that would point to very strange transcoder algos so chances are I’m just not understanding stuff correctly and that I’m being ignorant and that I am lacking fundamental knowledge of Plex, working with media and streams.
Any ideas guys, this seems so counter intuitive to me? Let me know if I can do some more tests. Movie plays fine without transcoding or if you select a profile where the computer can keep up with (i.e. 4k --> 1080 20Mbps).
Best regards
Stefan
PS:
Hope someone else besides me might think this is fun to try to understand and think about. Like I said earlier, this is not actually about fixing my issue. DLNA, XPlay (for subs) and Chromecast Ultra have me covered for that.
Edit reason
- Added linux distro