Converting H265 to H264 causes artifacts in dark areas

0

I'm not sure if this is the right place to ask this, but I'll try anyways. I'm trying to convert a lot of HEVC (H265) videos to AVC (H264) and I'm getting all these nasty artifacts in dark areas. Does anyone know why this is happening? I don't think it's a loss in quality, because I'm converting it to a video with a higher bit rate than the original. The H265 version does have a bit depth of 10 and the H264 with a bit depth of 8, but I'm not sure that would cause this. I'd really appreciate any help in this matter and hopefully some solution to fix this. I want the quality to be as close as possible to the original H265 version. The part of the command for video is something like this below:

-c:v libx264 -crf 23 -tune film -preset veryslow -profile:v high -level 4.1

Here is just one example of this:

Original (H265)

enter image description here

Converted (H264)

Converted AVC (H264) video

Jordan Harris

Posted 2016-04-04T05:29:20.293

Reputation: 181

Maybe it's just me but I can't see any difference between your two images. – DavidPostill – 2016-04-04T07:31:05.173

Sorry, I didn't capture it at its worst. I can still clearly see it though. Open it in a new tab and look at the bottom left of the image. There's this dark, blocky area there. The worst thing is that it moves around, making it very distracting and noticeable. – Jordan Harris – 2016-04-04T07:50:13.553

Don't see any artifacts in the 264 sample image. I stacked the two images in Photoshop. Aligned them, since they aren't identical, then did a difference mode blend and checked using the color picker. Only got the expected minor differences of =< 2 in each of the RGB channels. And that's due to both the bit depth difference, as well as the fact that you are encoding using a lossy standard. – Gyan – 2016-04-04T07:57:02.723

There is colour banding with blocky edges in the second image. Colour banding is the main effect of less bits per component on a gradient, and here it makes the artifacts of the compression more visible. The first image also has some slight banding, but with irregular and dithered edges. I have seen exactly this problem on every transcode I tried regardless of output bitrate, so to me it seems unavoidable. But I'm not a video expert, perhaps there is a solution for this.

– HalfKiloByte – 2016-04-06T20:41:56.937

There's indeed banding, and it's simply due to your bitrate being too low. If I were you, I'd use a lower crf such as 18 (or whatever value fits your needs). – Ely – 2016-04-08T21:36:11.287

I cranked up the brightness and contrast so the differences would be more obvious. As expected, the better encoding looks better. I don't see anything "wrong".

– Jason – 2017-12-14T17:22:15.553

No answers