Mpeg compression of difficult video

farss wrote on 10/10/2005, 2:39 PM
It had to happen one day, kiddies concert and there's one scene with lots of strobe lights and a deep blue wash over the talent, rest of the frame is black. The 2/3" camera coped just fine but trying to encode this to mpeg-2 for DVD results in some very ugly macroblocking. I'm encoding at 5.5 Mb/sec 2 pass VBR with ac3 audio, it's 90mins long and needs to fit on a SL DVD, no problems there, just the small sequences where the lighting goes over the top are what's causing the grief.
I'm guessing better (more expensive) encoders with more passes might do a better job or else hand encoding the difficult sections and then stitching the results together might be the answer but the former gets real expensive very quickly and the latter seems like a hit and miss affair. Heuris have encoders designed for the latter approach but yowsers, they're expensive.
Anyone have any better ideas?
Bob.

Comments

JJKizak wrote on 10/10/2005, 2:45 PM
My 2 cents. Try rendering that specific area to avi (even though it already is dv avi) then drop the avi back on the timeline in place of. Otherwise you might have to drop out the one bright strobe frame altogether. Or maybe crank the levels of those frames down color wise.

JJK
farss wrote on 10/10/2005, 2:59 PM
Thanks,
just going through the footage frame by frame and it's a mess, it's a tight shot of flowing satin with dim blue light and strobe flashes added over the top. There's a few frames where the fields are totally different and mpeg-2 is frame not field based, no wonder the poor encoder is have a heart attack!
I'm thinking adding some motion blur to average things out might mean less stress for the encoder.
Just to make things worse, apart from the intented strobe lights there's parents taking photos with flash, what a mess.
Bob.
JJKizak wrote on 10/10/2005, 4:37 PM
I had some 16mm stuff with a lot of strobing caused by flash bulbs and it was ok as long as it occurred one at a time. Also had a chopper flying into the sun overhead and that really raised hell. It did improve a lot after I rendered an avi of it but I can't tell you technically why it helps. I also tried Deshaker on the chopper and that was a disaster with the stand alone Main Concept codec.

JJK
farss wrote on 10/10/2005, 4:57 PM
Well a bit of MB, GB and Glow seems to have smoothed it out enough for the encoder to cope. Now the 'ghosts' look truly etheral but at least they aren't riddled with macroblocking.
Bob.
musicvid10 wrote on 10/10/2005, 7:25 PM
Bob,
If you can still fit it without VBR it might cure the headache, or could you put it on 2 discs? I've gotten 2hrs on a single DVD with pretty good results, but I can't for the life of me tell you if I used VBR or CBR.
farss wrote on 10/10/2005, 7:30 PM
Using VBR 2 pass encoding, limited to 5.5Mb/sec due to space constraints. There's less than 10 seconds of problem footage and with that bit even at 8Mb/sec CBR it still falls apart so splitting it over 2 DVDs will not help.
Just smoothing out the video before encoding has more impact than the bitrate etc. Lesson there I guess!
Bob.
busterkeaton wrote on 10/10/2005, 9:03 PM
Have you tried using the Black Restore FX?. The streaming preset starts at .020, but you may want to get more aggressive with it. It will clear up some bandwidth to deal with the rest of the encode.
farss wrote on 10/10/2005, 9:53 PM
That'd be fine if noise was the problem but this is from a 2/3" camera, I've looked pretty carefully and noise ain't the problem.
I found another problem segment, girls running with fine mesh capes, again tight shots and the client composited several layers of this just for fun, needless to say it's fairly reflective and there's lots of flashing lights shining off it.
Anyway I've worked some Vegas magic on it and left it to encode, see how it turns out this time.
Bob.
johnmeyer wrote on 10/10/2005, 10:01 PM
The high bitrate encoding and then stitching together the results is what I'd recommend. Strobe scenes are awful (I did one once and it never did look good). Smoke and fade transitions also give MPEG encoding fits.

A more expensive encoder probably won't help. Take a look at satellite and watch some music videos (which often use strobes and smoke). The encoders totally choke on this material.
dhill wrote on 10/10/2005, 10:16 PM
Hi Bob! I had the exact same problem with stage lights in my last project. I ended up using TMPGEnc since it has the remove block noise settings, remove ghosting and is very inexpensive. I'm sure you're familiar with it. After a lot of trial and error with the block noise settings, I got those scenes to look...well, not perfect but definitely OK. It softens the vid a bit, but that's better than big blocks. I used slightly higher settings (2 pass VBR-6.5 average with 8 peak and 4 for the min.) I believe, but I think it would still work at 5.5. Good luck!
busterkeaton wrote on 10/10/2005, 10:32 PM
I wasn't suggesting that noise was a problem. Just as a way of equalizing the black portions of the frame.
farss wrote on 10/10/2005, 11:32 PM
I've a full version of TMPGEnc and it is great, despite the arcane UI, use it mostly for mpeg-1 for VCD at which it really shines, haven't seen any real advantage to it over the MC encoder so it doesn't get much use lately.
Anyways thanks to everyone for all the advice, I think it's under control now.
Bob.
farss wrote on 10/13/2005, 12:12 AM
Just a final update on how this one problem area all worked out.
In the end what killed the macroblocking was rendering the section to progressive using interpolation, killed half the vertical res but that wasn't of any concern as I was applying GB and glow to the video anyway.
Dropped the 25p footage over the top of the same section and faded it in and out at the ends and voila, encoder now copes.
What is really interesting was the scene was lit with deep blue light and the strobe flashes created frames with vastly different fields. In that situation it seems that the Vegas FXs don't do much to help, GB for example blurs each field as a discreet entity, merging them into a frame or ditching one field first produces a very different result. One side effect though, I did get some chroma banding in the blue, still that doesn't look anywhere near as bad as the macroblocking.
All in all an interesting exercise, needless to say one of the ones you bill to 'training' :)

Hope all this at least saves someone else a lot of hair pulling.
Bob.
johnmeyer wrote on 10/13/2005, 7:23 AM
If you blur it enough and eliminate resolution, then of course you'll eliminate the blocks. However, I would think that for most viewing the soft video would be almost as objectionable.

A better way to go (other than the ideas I posted earlier) would be to find an encoder that lets you manually encode GOPs. I assume that the pro encoders let you go through a tough sequence like this, where every frame is different, and force the encoder to encode each frame separately. Otherwise it is trying to encode a brand new frame using only the difference vectors, and there simply aren't enough difference vectors available, given how the MPEG spec works, to create a viable image. This is what creates the blocks.

farss wrote on 10/13/2005, 7:58 AM
John, there's pretty well no resolution in the video to start with and the characters on stage are supposed to be ghosts so a bit of blur etc actually serves in this case to enhance the image.
However the real point here is that no, even with a lot of blur as I was still getting macroblocking. Problem seems to be at the field level. Two fields of the frame are totally different and Vegas it would seem blurs each field but the encoder is encoding frames. What I can see is one field of intense deep blue, next field is bright white, next field deep orange etc. From what I can see the encoder doesn't have to just encode motion it has to encode the whole gamut of color, so a motionless image that's rapidly changing color is as much of a nightmare to encode as anything and that's what was happening with this few seconds of footage. Sure encoding it as all I frames might fix the problem but part of the problem is that even the DV codec and therefore I assume the DCT encoder within the mpeg-2 encoding process isn't having much luck either.
Looking at a few frames on the scopes shows one frame with 100% in the B channel and almost 0 in R and G, next frame 100 in all channels, next frame might be 100 in the R and the others at 0.
Bob.