Trying to achieve near perfect black levels using MPEG-4 AVC's h264 encoding

Started by AcerBandit, March 09, 2012, 05:21:51 AM

Previous topic - Next topic


I'm trying to achieve near perfect black levels using MPEG-4 AVC's h264 encoding but no matter what settings I try I can't get good black levels  They always come out to be an off-black or really dark gray.  I have some borders (and chopping them off is not an option nor is adding black borders) that are originally pitch black - perfectly black 000000.  I use these videos on a black website so it stands out.

I encoded a file using XVID instead just to make sure Avidemux could achieve the black levels I wanted at all, period, and it was successful.  I'm going to show you the results.  On the left will be normal and the on the right will be with the lightness increased to exaggerate the effect to make sure you understand I'm not just making this up.

Here's the capture using xvid which is successful at matching pure black:

And here's another snippit of a file encoding with h264 or x264 or whatever it's using:

I added a small perfect column of black to the left of these images to give you some context of what it should be matching.

I know this is a small nitpick but I really want to do this correctly.  How do I achieve the black levels I desire using h264 and Avidemux?


I was using 2.5 in the previous post, so out of curiosity I tried using the latest 2.6 nightly build.

It gets the great black levels I want.  So success there.  However, new problems result.

Whenever I skip around in the resulting file I get this weird green stuff in the lower corner of the player.  It disappears after about 3 seconds but it's annoying and I don't want it.

The other problem is now the audio is out of sync with the video.  I used to get a prompt for building a VBR time map with 2.5.  I don't get that with 2.6 and I don't see any option for doing that in 2.6 so it creates these out of sync video files and that just won't work.  Where did that wonderful feature go?

So I guess I need help in either getting black levels I want in 2.5 or getting a file that doesn't make that green pixel noise and audio that is in sync in 2.6.  Please help!

Jan Gruuthuse

The player green artifacts is probably only in the avidemux player and not when viewing the saved content in another player?
2.6 is not frame based rather time based. The audio shift is this in the saved content outside avidemux to?


1) The green stuff I'm referring to appears when I use an online browser video player (jwplayer).  It doesn't show up in AviDemux.  It's only on the resulting encoded file.

2) I need the "Build VBR Time Map" feature that AviDemux 2.5 has in order to not have have syncing issues.  I can't find the feature in AviDemux 2.6 at all.  Are you saying that 2.6 is so drastically different that it no longer can do this?

Jan Gruuthuse

Not saying that. 2.6 is a work in progress and very experimental: Dont use it for serious stuff.
The "Build VBR Time Map" I can't answer on that one.
Online browser issue? Check with MediaInfo if there are codec differences when you make from same source video a clip with avidemux 2.5.6 and 2.6. Do other online browser video players have the same issue?