Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Off Topic (https://forum.jellyfin.org/f-off-topic) +--- Forum: Media (https://forum.jellyfin.org/f-media) +--- Thread: Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode (/t-ahead-of-time-x265-transcode-looks-much-worse-than-jellyfin-qsv-transcode) |
Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode - StaticUnit97 - 2025-01-03 Not sure if this is the best place for this, since it's not really a Jellyfin issue. One user of my Jellyfin server has to stream at bitrates ~8mbps due to connection limitations at times. For the movies and shows they enjoy, I was going to transcode these files ahead of time using Handbrake with x265 to ideally preserve as much of the quality as possible. As a test, I took an existing movie encoded at 1080p 40 mbps with H.264 and re-encoded it to H.265 using the x265 10-bit encoder. I used RF 24, slow preset, and no tune, and the resulting average bitrate was 6.8 mbps which was perfect. However, the resulting quality of the video looks much worse than just using Jellyfin's on-the-fly transcoding using H.265 QSV and forcing a bitrate of 5mbps. How can I improve the H.265 x265 transcode? I assume that the settings Jellyfin uses with its version of ffmpeg have been pretty well tuned, but I was not expecting such a drastic difference in quality. Any help is appreciated! RE: Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode - Efficient_Good_5784 - 2025-01-03 From my own personal experience and bias, using the GPU to transcode almost always results in worse video quality per bitrate used when compared to using the CPU. What you consider better may just be something you're used to that feels better to you. It would be helpful if you could share PNG screenshot examples of both encodes to have us better understand what you're experiencing. Also as a note that I want to add. Unlike H264 where going with a slower preset lowers the final output size, going with slower presets for H265 actually increases your final video size. Slower presets in H265 use more complex algorithms to better capture movement detail and other things which use more data. That said, if you care about quality, the slow preset is recommended to be used as a minimum like you are. RE: Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode - bitmap - 2025-01-03 This might belong better in the off-topic ffmpeg megathread that TDP and I resurrect on occasion, but there are a TON of x265 params that you can set with ffmpeg, so playing with some of those might be the answer. I'm much more familiar with the QSV encoders or libsvtav1. For example, here's the output of ffmpeg -h encoder=libx265: Code: Encoder libx265 [libx265 H.265 / HEVC]: The key here is the x265-params option, which allows you to utilize the libx265 command line parameters which provide a lot of flexibility. I'll try to be as general as possible below:
I think part of this depends on the route you want to go: Handbrake or ffmpeg? HEVC or AV1? Hardware-accelerated or not? What sort of hardware are you running these encodes on? RE: Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode - StaticUnit97 - 2025-01-03 (2025-01-03, 06:52 PM)bitmap Wrote: I think part of this depends on the route you want to go: Handbrake or ffmpeg? HEVC or AV1? Hardware-accelerated or not? What sort of hardware are you running these encodes on? Thanks for all the good info! Some replies to your final questions:
Thanks! RE: Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode - Efficient_Good_5784 - 2025-01-03 (2025-01-03, 07:56 PM)StaticUnit97 Wrote: I'm running this on a 5700X3D, so 8C/16T, on Windows. I'd probably use ffmpeg in WSL. The Jellyfin server has a i5-9500T, which is 6C/6T.You can look at ffmpeg's website to find Windows builds of ffmpeg: https://ffmpeg.org//download.html You just get that, unpack it, then all you need to do is navigate to it using command prompt and run it there. RE: Ahead-of-time x265 transcode looks much worse than Jellyfin QSV transcode - bitmap - 2025-01-03 (2025-01-03, 10:21 PM)Efficient_Good_5784 Wrote: You can look at ffmpeg's website to find Windows builds of ffmpeg: https://ffmpeg.org//download.html I might recommend using jellyfin-ffmpeg. There's a win64 version in a ZIP file that should install similarly to vanilla ffmpeg. The reason for this is all of the included extras pre-compiled. Here is my "script" for libsvtav1 encodes which, fortunately, has an svtav1-params list that uses the same syntax as libx265 if you decide to experiment there. Code: MEDIA="MEDIA" && INPUT="INPUT" && \ Customize to your needs and remove anything you don't want or will not use. Here is documentation on the libsvtav1 params. Keep in mind a few things:
Remove all my comments before running, remove or replace all identified placeholders or parameters. Software encoding in AV1 is an extremely slow process. I have an i7-13700k and my speed is ~0.3-0.7x for most applications. Adding additional filters (e.g., smartblur, yadif) will impact performance. Ask any questions you have, I can try to answer. I know that nyanmisaka is our resident ffmpeg expert and others may have different opinions, but I'm quite happy with the simple setup above. |