wonkey_monkey
26th May 2012, 00:34
Hi all,
I've written a filter to restore video with blended fields/frames using a reference source - in my case, I have an SD source at native 25p and an HD source of the same video which was converted to 60i.
srestore did a near-perfect job; however, I wasn't happy that srestore doesn't give consistent results when seeking, nor that I still had residual chroma blends.
So I wrote a couple of very quick filters, one to pick out the unblended frames from the (bobbed) HD video to match the SD video, and another (possibly the more useful) to undo any residual chroma blending.
Here's the download: specials.zip (http://horman.net/specials.zip) (caution: potentially highly unstable!)
And here's a very rough overview:
blended=... # a blended HD source, in my case a Blu-ray rip
reference=... # an SD source of the same video, in my case a DVD rip
# now prepare two matching progressive clips from the above
# (I cropped because the DVD rip had black bars at left and right but the Blu-ray didn't;
# I also had to shift one picture a little, and blurring both may help get saner matches.
# You may also have to do some trimming)
blended_compare=blended.bob.bicubicresize(720,576).crop(16,0,-16,0).blur(1.58)
reference_compare=reference.crop(16,0,-16,0).blur(1.58)
# now use the filter planetmatch to restore the unblended frames
unblended=planetmatch(blended, blended_compare, reference_compare)
#########################
# if there is still blended chroma:
#########################
unblended_compare=unblended.bicubicresize(720,576).crop(16,0,-16,0)
# ^ to match reference_compare from above
chromafix(unblended, unblended_compare, reference_compare)
Please note: the filters should be used with caution - they do absolutely no sanity checking, and have only been tested with YV12 clips. If there is interest I will tidy them up, but I want to gauge that first as it seems an unlikely scenario.
Sorry if my terminology is a little confused - different kinds of blends being discussed with the same terms, etc - and for the cryptic filter name :)
Edit: chromafix in action: (image) (http://horman.net/chromafix.jpg)
David
I've written a filter to restore video with blended fields/frames using a reference source - in my case, I have an SD source at native 25p and an HD source of the same video which was converted to 60i.
srestore did a near-perfect job; however, I wasn't happy that srestore doesn't give consistent results when seeking, nor that I still had residual chroma blends.
So I wrote a couple of very quick filters, one to pick out the unblended frames from the (bobbed) HD video to match the SD video, and another (possibly the more useful) to undo any residual chroma blending.
Here's the download: specials.zip (http://horman.net/specials.zip) (caution: potentially highly unstable!)
And here's a very rough overview:
blended=... # a blended HD source, in my case a Blu-ray rip
reference=... # an SD source of the same video, in my case a DVD rip
# now prepare two matching progressive clips from the above
# (I cropped because the DVD rip had black bars at left and right but the Blu-ray didn't;
# I also had to shift one picture a little, and blurring both may help get saner matches.
# You may also have to do some trimming)
blended_compare=blended.bob.bicubicresize(720,576).crop(16,0,-16,0).blur(1.58)
reference_compare=reference.crop(16,0,-16,0).blur(1.58)
# now use the filter planetmatch to restore the unblended frames
unblended=planetmatch(blended, blended_compare, reference_compare)
#########################
# if there is still blended chroma:
#########################
unblended_compare=unblended.bicubicresize(720,576).crop(16,0,-16,0)
# ^ to match reference_compare from above
chromafix(unblended, unblended_compare, reference_compare)
Please note: the filters should be used with caution - they do absolutely no sanity checking, and have only been tested with YV12 clips. If there is interest I will tidy them up, but I want to gauge that first as it seems an unlikely scenario.
Sorry if my terminology is a little confused - different kinds of blends being discussed with the same terms, etc - and for the cryptic filter name :)
Edit: chromafix in action: (image) (http://horman.net/chromafix.jpg)
David