RasPlex / OpenPHT

OpenPHT is a community driven fork of Plex Home Theater
Other
599 stars 109 forks source link

Screen Tearing on h.265 Direct Playback #189

Open Haravikk opened 7 years ago

Haravikk commented 7 years ago

So I installed the latest beta release (1.7.1) on my media server, so that I could get direct play support for h.265, however I'm noticing a lot of screen tearing that I did not get when my sources were transcoded instead.

Now, my media centre PC isn't the most powerful in the world; it's an older 2010 Mac Mini with 2.4ghz Core 2 Duo and NVidia GeForce 320M, however it does play the same h.265 media files without issues when played locally with VLC, so the issue appears to be OpenPHT specific.

That said, OpenPHT on a much more recent, and more powerful machine does not appear to experience this same issue. Both are running the same version of macOS El Capitan (10.11.6).

The media source in question is a file I transcoded myself using Handbrake, encoding as h.265 with variable bit rate (constant quality). This is the same way that I have transcoded older h.264 files, which play just fine (even though the bit-rate must surely be higher), so it shouldn't be a network issue, especially since I'm on a good gigabit local network.

I've tried some of the various video options that seem like they could help, such as syncing to refresh rate, and letting OpenPHT set the refresh rate, but neither helps.

Any ideas what's going on here? The fact no apparent issues occur on better hardware seems to suggest it's the older hardware at fault, yet decoding the h.265 stream doesn't seem to be taxing the Mac Mini overly much (it isn't pushing the CPU enough for the fan to kick in), and I use a buffer size of 10%, so I shouldn't think it's having trouble decoding frames fast enough; I've noticed no obvious stuttering or lag in playback, only the aforementioned tearing when the camera pans or a lot is happening in the shot.

I'm not sure what else I can do to identify the issue; as I say playback in VLC is fine, and I assume OpenPHT uses the same library for decoding h.265 sources, any ideas how I might narrow the problem down further? When I get a chance I'm going to try encoding one of the most obviously affected files with a constant bit-rate, to see if that makes a difference, but I don't believe VBR is causing the bit-rate to spike especially high, in fact the highest I've seen is about what I would set for constant bit-rate anyway, so VBR is really just making the file-size a lot smaller.

In the mean time I've disabled direct play, which solves the problem for playback, but decoding and re-encoding h.265 on the fly is quite demanding on my server (which is why I was looking forward to h.265 direct play support). I know my media centre PC is getting older, but it just doesn't feel like I'm hitting a performance wall anywhere so I'm hoping it's a glitch with decoding, or something that can be fixed somehow.