bozrdnag 75 Posted June 9, 2021 Posted June 9, 2021 I first posted about this in the Linux forum with no feedback, so I am trying again here. Sorry if that's poor etiquette. Anyway, I've been trying transcoding with 4K/HDR content and I first noticed the image was blurry. After doing some investigation it seems that the issue is that 4K/HDR content is being transcoded to a lower resolution than 1080P content given the same bitrate setting. For example, I usually have my users set their bitrate to 1080p - 5Mbps on their clients (and I have it capped at that in the server settings). This has always provided a nice, sharp image on my 1080p BluRay content and viewing Stats for Nerds shows the Video resolution at 1920x1080 under Playback Info. The same setting results in Video Resolution of 720x405 with 4K/HDR videos. I have to increase the setting to 10Mbps to get 1920x1080. My question... is this expected behavior, or should it be transcoding to 1080? ffmpeg-transcode-e05deb28-c06d-4240-bbec-de4d97d6424d_1.txt
Carlo 4561 Posted June 9, 2021 Posted June 9, 2021 Here is something to think about which will likely help you understand the bitrates. If you have something that is 1280x720 you have less than 1 million pixels being used. If 5Mb keep this fluid looking but you now jump up to 1920x1080 which has a bit more than 2 million pixels you need to double the media's bitrate normally to keep the same fluidness. That's using the same video codecs. Now if you are switching codecs on the fly from HEVC to AVC you just made things twice as bad in generally because a good HEVC encode will only need 1/3 to 1/2 the bitrate an AVC codec does. Or put another way a 10Mb HEVC file may need 20Mb if converted on the fly to AVC to carry the same quality. So hopefully you can see why you may need more bandwidth then you think for these or why a 5Mb 1080p AVC version isn't really doable from a 4K, high bitrate HEVC file. You will likely need to have 1080 8Mb to 10Mb at the lowest for these to approximate a decent picture. 1
bozrdnag 75 Posted June 10, 2021 Author Posted June 10, 2021 So this is to be expected and, if I understand correctly, can not be improved with hardware acceleration or a beefier system? That's a bit of a bummer. I only have 20 Mbps upload so at 5 Mbps I had no problem with 3 people streaming from me at once. If users need to bump it to 10 Mbps to get the same quality on their end then I'm looking at 2 concurrent streams max and that might even be problematic if my service dips at times. I was really hoping I could get away with having two copes of the same movie just for streaming purposes. Thanks for a detailed explanation!
Carlo 4561 Posted June 10, 2021 Posted June 10, 2021 Having two copies will always likely be the best solution if they were mastered that way. When you think about it what we are trying to achieve and do a great job is to process on the fly at faster than playback speed a lowering of resolution, a change of color space, color correction and adjustment as well typically of changing video codecs from a highly compressed HEVC version to an AVC version that roughly speaking has only 1/2 the compression of HEVC. All of that (just a brief overview) is taking place on a PC or NAS with a normal GPU assisting. There might actually be a couple of these taking place at the same time as well. Now compare that to a professional version prepared specifically for 1080 from film or high end video using equipment dedicated to these tasks. These often that takes months to engineer (often frame by frame) with both sound and color correction taking place as well as filtering to remove or bring out grain marks, etc. When you look at it that way it's remarkable how well many HDR->SDR 4K films tone-map to 1080 on the equipment we have available. But to try and hold onto the higher quality you can get from the 4K version you do need more bits than what would be needed by the profession version engineered specifically for 1080. Keep in mind this is the first server version to support tone-mapping so there is room for improvement down the road. One of the things that could be quite beneficial is delivering the media using HEVC vs AVC but that requires other substantial architectural changes that have already been started. So there is room for improvement but it's not simple and will take a bit of time to work out all the architectural changes needed. 2
bozrdnag 75 Posted June 27, 2021 Author Posted June 27, 2021 Sorry I'm late responding. Please don't misunderstand my last comment. While it's a bummer for my desires, I totally understand and appreciate how much work and effort goes into making Emby what it is. Likewise, I also understand that what we're doing with consumer level hardware can't compete with professionally mastered discs. Emby does a great job and transcoding (even 4K HDR) looks good to my eye. Keeping two copies of movies is time and space consuming. If my ISP had better upload speeds this wouldn't even be an issue. The problem for me is that Auto often doesn't work well and often selects a low bitrate. So, based on my testing, users need to be set at 10Mbps for good quality on 4K content. But when they are viewing standard 1080p BR content (which is currently 90% of my library) that is more than they need and is unnecessarily using more of my available upload bandwidth. Maybe someday the auto setting could be enhanced to work better and allow a higher limit if it's 4k content. 1
bozrdnag 75 Posted June 27, 2021 Author Posted June 27, 2021 To anyone who may care, I have made a feature request to allow for separate bitrate settings based on content resolution. For example; one setting for 1080 and below and a separate setting for 4K. Here is the link in case you would like to voice your support for said option: Option to allow for different streaming bitrate for 1080 vs 4K content - Feature Requests - Emby Community
RanmaCanada 499 Posted June 27, 2021 Posted June 27, 2021 It is actually far more beneficial to have a separate 4k Library and honestly I would only serve those movies to yourself in your own home, and if your friends or family want to watch them, tell them to provide you with a hard drive so you can copy them to it. 4k should never be transcoded, ever, but because the community demanded this insanity, the devs made it possible. Just because it can be done, doesn't mean it should be. 1
bozrdnag 75 Posted June 27, 2021 Author Posted June 27, 2021 How can you make such fervent claims without even beginning to explain why? What could possibly be wrong with transcoding 4K?
RanmaCanada 499 Posted June 27, 2021 Posted June 27, 2021 2 minutes ago, bozrdnag said: How can you make such fervent claims without even beginning to explain why? What could possibly be wrong with transcoding 4K? What could be wrong, besides the MASSIVE system resources required not only for the transcode itself but also for the tone mapping, the resultant encode will no where be as good as the original file, PERIOD. Tone mapping is far from perfect, and the whole reason to watch a 4k movie is for the detail, and for that beautiful HDR/DolbyVision picture. If you don't even understand the basics of this, then please take some time and educate yourself. I would suggest you start here https://www.avforums.com/articles/what-is-4k-hdr-tone-mapping.13883
bozrdnag 75 Posted June 27, 2021 Author Posted June 27, 2021 That is an elitist attitude that ignores so much! On top of that you assume ignorance on my part. I am fully aware of all of the benefits of 4K and HDR. Drop your personally zealousness for a moment and consider other scenarios. Do you realize that many people don't have HDR or 4K capable TVs? Do you realize that, even of those who do, many can't tell the difference? That is the case for every one of the 6 users who stream from me. They absolutely DO NOT care if it looks as good the original disk. They just want to watch a movie and have it look reasonably good. I, on the other hand, have nothing but 4K HDR displays around my house. So I want the full res HDR content on my displays. And it's awesome to have the ability to stream a decent version of it to friends and family who couldn't care less about those nuances. It's a not a religion to them. It's merely a couple hours of entertainment. So you have failed to adequately explain why "4k should never be transcoded, ever". You've merely explained why it's you preference not to.
Carlo 4561 Posted June 27, 2021 Posted June 27, 2021 What @RanmaCanada is saying is that you should use 720/1080 versions for normal viewing and only provide 4K library for internal use or those who can direct play it from you assuming you have the bandwidth to stream it. If you don't understand all the "uniqueness" of 4K files just don't share these files until you better understand what can/can't be reasonably done with them. A good 1080 rip will usually still be better 90% of the time then a tone mapped version from 4K HDR media when played back in a 1080 non HDR environment and that's assuming you're tone mapping to at least 10Mb. If you tone map to a lower bitrate the 1080 pure version will most certainly almost always be better.
bozrdnag 75 Posted June 27, 2021 Author Posted June 27, 2021 4 minutes ago, cayars said: What @RanmaCanada is saying is that you should use 720/1080 versions for normal viewing and only provide 4K library for internal use or those who can direct play it from you assuming you have the bandwidth to stream it. If you don't understand all the "uniqueness" of 4K files just don't share these files until you better understand what can/can't be reasonably done with them. A good 1080 rip will usually still be better 90% of the time then a tone mapped version from 4K HDR media when played back in a 1080 non HDR environment and that's assuming you're tone mapping to at least 10Mb. If you tone map to a lower bitrate the 1080 pure version will most certainly almost always be better. I understand what @RanmaCanada is "trying" to say. My issue was with his zealousness. We can talk about best or better all day long but that doesn't make other avenues wrong or mean that they should never be taken. And what's wrong with good enough if the viewer is happy? Are most people are unhappy with Emby's transcoding and DTM of 4K content? Are you saying that transcoding and/or DTM in Emby is liable to butcher the quality to the point of being unwatchable? I don't have a ton of UHD content at this point (~20 discs), but I've tested all that I do have and haven't noticed any real issues as long as the bitrate is set to 10Mbps like you mention. Even my daughter has streamed most of them and says they look good. If this all so vastly inferior or yields such poor quality, then why did the devs implement this feature and why is there demand for it? What am I missing?
Happy2Play 9783 Posted June 27, 2021 Posted June 27, 2021 Well before 4.6 there was no tone mapping so all hdr content was washed out when transcoded. So from a transcoding standpoint you have to choose if tone mapping gives that remote viewer watchable media. Transcoded h265 is converted to h264 with bitrate double (settings dependent) to maintain quality from the high compression of h265. But across the board there are many variables as high bitrate media has never been designed to be streamed via network. Just like streaming service media has not were near the bitrate of personal 4K media, usually a max of 25Mbps where personal media is 50-100Mbps. 2
Carlo 4561 Posted June 27, 2021 Posted June 27, 2021 As @Happy2Play is saying this all depends on the admin and his system, what hardware is available for transcoding/tone mapping, the source of the media and it's bitrate along with your server's upload bandwidth and the client's download bandwidth. So it all depends. Surely Emby Server 4.6 ads new ability that wasn't previously available and this might be perfect for you as is. For others it may not be and they might be better off with multiple versions of the same media. Only the admin of the system will know what's best for their system/environment and their clients. All anyone here can do is provide guidance to how they do it or what can be done. Past this you need to test on your system to see what works and what is best for you. That's basically the bottom line. 1
bozrdnag 75 Posted June 28, 2021 Author Posted June 28, 2021 Understood guys. I was never under the delusion that transcoding or tone mapping would yield results equivalent to the disc. That was the case even before 4K and HDR. It has always been a trade off. I was just surprised by the attitude towards to keep multiple versions. If that's the general recommendation, then whats' the point of the new feature in 4.6? I'll keep testing and hopefully my users will conclude that the performance is such that there's no need to keep multiple versions. And I still think my feature request is a good idea towards that end.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now