My old piece of shit digital camera films MPEG-2 format with keyframes every 24 frames at a low bitrate, and there's a noticeable flicker as the keyframes are lower quality than the P/B-frames. I have to denoise anyway because some scenes were filmed indoors but the flicker every 12 frames won't really be purged, so I thought of decimating the video where every second (rather than every 12th) frame will be those ugly frames, run the denoising on that stream and somehow put the video back together, but this is the part that escapes me.
I know Avisynth has an Interleave() feature which would come useful in the last steps, but I need a Deinterleave() to begin with, or could my solution to the problem be best classified as linear retard-thinking because there's a simpler solution out there?
+ Reply to Thread
Results 1 to 8 of 8
I don't think exactly what you're proposing will work -- you want two temporally adjacent frames for the best filtering. Then apply a heavy 3 frame temporal filter. If the keyframes are always at exact 12 frame intervals you can use SelectEvery() to extract the keyframes with the two frames surrounding it. Assuming the sequence starts with a keyframe:
SelectEvery(12, 0, 1, 11)
Of course, the very first frame will only have one neighboring frame.
Then you have to figure out how to get those filtered keyframes back into the original video. I'll have to think about that. The first thing that comes to mind is to use 12 SeparateFields() with one frame each and an Interleave() with all 12 of the individual frames.
Interleave(f0, f1, f12... f11)
Last edited by jagabo; 12th Jan 2011 at 13:06.
Are you sure it's like that, and not the other way around ? In most compression schemes, the I frame will be much larger and better quality, so every keyframe it "pops" back into better quality , then deteriorates until the next keyframe "pops" back in
Yeah, it's backwards from the usual. But I've seen cameras that do it. Apparently, they allocate the same number of bits to I frames as P frames. Since the I frame has to encode the entire picture it comes out lower quality, especially with still shots.
No need to separate fields, I already deinterlaced everything. So I guess its 24 instead of 12 frames now, my bad.
Sweet, jagabo's method was clever and robust. It worked smoothly.