View Full Version : Constant flickering when encoding to Blu-ray


Wizecat
15th May 2010, 18:25
I just finished encoding a few 480 samples using default x264 settings and transfered them successfully to BD using Blu-ray specs. All of the samples play very well but there is a very noticable flickering caused by the very low keyint setting (keyint 24). I can see the flickering on my computer screen but it's even more noticable on a regular TV. Has anyone actually used the low keyint setting required for BD to examine this? It's really bad. If you haven't and have some spare BDs try it, I'm sure you'll notice.

It makes little sense to me to have all of the great optimizations of this codec and then get annoying flickering because of one setting. Computer based media players like Divx and VLC have play files with keyint 240/min-keyint 24 without problems.

Dark Shikari
15th May 2010, 18:30
Can you post an output sample? I haven't seen this problem very often, especially not at Blu-ray quality levels.

I suspect you have made a mistake somewhere, as I have done a great deal of testing with low keyints and I haven't had any issues at all. See the official x264 Blu-ray for example; it looks just fine.

shon3i
15th May 2010, 20:48
I haven't seen this problem very oftenWell it's more often than you think, and it's produced with short GOP's, ipratio/pbratio to 1.1 should fix little (impossible with mbtree i know), but i think that OpenGOP will be ulitmate solution.

Btw, i just see that some comercial BD encoders have something like "Pulse Reduction" which work very well, but isn't OpenGOP

Dark Shikari
15th May 2010, 20:53
Well it's more often than you think, and it's produced with short GOP's, ipratio/pbratio to 1.1 should fix littlepbratio is utterly unrelated.

I've seen this sort of flashing at QP30-40 with extreme VBV restrictions, sure, but not Blu-ray bitrates.

As there are many possible causes, I need to see the source before I can give a verdict. Don't make wild speculation before you've seen the actual "problem".

mp3dom
15th May 2010, 22:28
In general the 'pulse reduction' on commercial bd encoders are turned on when you're encoding HD material at bitrates below 8 Mbps. For higher bitrates I think they change the quantizer matrix.

CruNcher
15th May 2010, 23:13
@shon3i
As Dark Shikari said i-frame pulseing @ such High Bitrate is very strange you need really low bitrate for x264 to trigger it in Blu-Ray especialy with BugMasters AQ enhancements which ease the pain a little, though also of course depends on the complexity of the scene :). Intra Refresh also does a nice Job and even with forceing IDR frames it looks much nicer then the normal pulseing.

Wizecat
16th May 2010, 02:25
Can you post an output sample? I haven't seen this problem very often, especially not at Blu-ray quality levels.

I suspect you have made a mistake somewhere, as I have done a great deal of testing with low keyints and I haven't had any issues at all. See the official x264 Blu-ray for example; it looks just fine.

Hi Dark Shikari. Okay, I've made a small sample. Notice the flicker on faces, trees outside, castle door and table inside. http://rapidshare.com/files/387813274/flicker_sample.zip.html

Here are the settings that I used:

--keyint 24 --min-keyint 1 --profile high --level 3.0 --vbv-bufsize 10000 --vbv-maxrate 10000 --nal-hrd vbr --rc-lookahead 40 --qpmin 10 --qpmax 30 --bframes 3 --slices 1 --trellis 0 --ref 4 --deblock -3,-3 --subme 7 --scenecut 40 --direct spatial --me umh --merange 16 --b-adapt 2 --b-pyramid strict --weightb --weightp 0 --partitions all --8x8dct --psy-rd 1.0:0 --no-fast-pskip --no-dct-decimate --aq-mode 1 --aq-strength 1 --aud

poisondeathray
16th May 2010, 02:55
1) 720x384 isn't a supported blu-ray resolution
2) 1.2Mb/s isn't a "typical" blu-ray bitrate , even for sd
3) progressive encoding for SD resolutions isn't compatible for blu-ray primary video
4) Using a mkv container will often give you problems when authoring, it's recommended to encode to raw avc before authoring
5) If you are using <15Mb/s you can use the "long gop" settings which are 2x fps - see shon3i's chart and post on blu-ray

Wizecat
16th May 2010, 04:28
@ poisondeathray. I know that the official specs say 720x480 for standard definition but it won't make a difference with the flicker if it's encoded at 720x480 or 720x384, I just cropped. The container makes no difference either.

As far as I know, SD at 23.976 progressive is Blu-ray compliant. It is used by Sony Blu-code encoder.

Dark Shikari
16th May 2010, 06:58
I can barely see any flicking on I-frames; of course, your source is flickering all over the place grain-wise, not just on I-frames, which makes it even harder to spot anything. So my take is that I simply can't see any significant problem and I wouldn't have noticed anything at all if I wasn't looking for it.

Of course there's the fact that you're using bitrates way too low for actual Blu-ray encoding; there's no reason to use that low a bitrate on a real Blu-ray, and if you're not encoding a real Blu-ray, you don't need a short keyframe interval. Keep in mind that short keyframe intervals are very bad for compression with all but the highest bitrates, so while x264 might be able to do a great job normally on a 1.2mbps SD clip, using a keyint of 24 is going to suck up a huge proportion of the bits, making it look much worse.

Now, yes, things could be improved (and I have had an algorithm in mind to do so for some time), but this particular problem is largely of your own making.

Atak_Snajpera
16th May 2010, 11:59
Instead of Blu-Ray you should encode to AVCHD (level 4.0). Blu-Ray players accept long gops (fps*10) without any problems.

poisondeathray
16th May 2010, 14:37
@ poisondeathray. I know that the official specs say 720x480 for standard definition but it won't make a difference with the flicker if it's encoded at 720x480 or 720x384, I just cropped. The container makes no difference either.


Yes, actually it will make the flickering slightly worse,at the same bitrate because of a larger frame size (even if they are filled with black borders). I was just explaining potential problems with your "blu-ray"

I can clearly see the flickering, and point #2 (low bitrate) was the major contributing reason why, given your less efficient encoding settings with blu-ray restrictions. Even if you didn't use mb-tree , and adjusted smaller IP/PB ratios , then the overall quality of the frames would decrease. As DS pointed out, since you're not even even using compatible blu-ray settings, you might as well avoid the imposed restrictions.


As far as I know, SD at 23.976 progressive is Blu-ray compliant. It is used by Sony Blu-code encoder.

But the signal isn't 23.976 progressive is it? It's telecined 2:3 to 29.97 , not what you're using


Instead of Blu-Ray you should encode to AVCHD (level 4.0). Blu-Ray players accept long gops (fps*10) without any problems.

This isn't my experience. Some players can play it without issues, some will stutter. Many others have experienced the same

Atak_Snajpera
16th May 2010, 14:39
This isn't my experience. Some players can play it without issues, some will stutter. Many others have experienced the same
good brands or some garbage from china?

poisondeathray
16th May 2010, 14:48
good brands or some garbage from china?

Good ones. Sony seems to play the illegal GOP settings, as long as b-frames are still <3 without b-byramid, but my Panasonic stutters with anything over. I even did several tests , adjusting the GOP size, verifying the stream , then testing playback , and it is definitely the cause (i.e not some other setting). The other common causes are incorrect buffer values , and illegal b-frame settings , but I controlled for those in this test.

I haven't used any of the cheap ones, but I've heard horror storries. You can look in the multiavchd thread and several others - reducing the gop size to legal limits seems to fix the stuttering.

Atak_Snajpera
16th May 2010, 15:10
I had access for few months to samsung BD and I haven't noticed any problems either. BTW. We all know that Panasonics are very picky :)

Wizecat
17th May 2010, 19:27
I've been doing a few more encodes with various changes to the encoder settings including modifying the ip and pb ratios as recommended in another thread http://forum.doom9.org/showthread.php?t=147242. Maybe this works more at higher bitrates instead of low ones. In my case reducing ipratio didn't seem to have any significant impact on the flicker but increasing bitrate did make a difference. At 2000 the flicker isn't as noticable as much and at 3000 it isn't noticable at all unless you really try to find it.

I was doing an internet search for flicker in H.264 and found a paper about a way to reduce it. Apparently it's a known issue with the codec. The paper is "Intra Prediction Mode Selection for Flicker Reduction in H.264/AVC". It can be found at the publications section at Korea University (mpeg.korea.ac.kr).

@ Atak_Snajpera. I'll probably try AVCHD. I'm just not sure what I should use for the settings.