Log in

View Full Version : Automatically detect correct re-interlace order?


ChiDragon
27th January 2016, 20:17
I capture 480p60 from the HDMI output of some devices that won't do 480i over HDMI. The original content they're displaying is 480i60, which I retrieve manually with a nearly-typical reinterlace script.

# Reinterlace v1.1
#
# Takes progressive input and re-interlaces it, outputting TFF. Specify input field order: TFF=1 & BFF=0.
#
function Reinterlace(clip c, int "order")
{
order = Default(order,1)

T = (order == 1) ? c : c.Trim(1,0) # Changes BFF to TFF, matching all my other devices

return T.AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
}

It's easy to see which fields are needed from the source visually. They have lines with a height of 1 pixel instead of "0.5 px", if you will... Looking at the captured progressive frames, it isn't clear to me, but I've included them for completeness.

Reinterlace(1) vs Reinterlace(0)
http://s18.postimg.org/wqe5asmd5/DVDR3575_H_JVC_Menu_Reinterlace0.jpg http://s18.postimg.org/dzc80mrsp/DVDR3575_H_JVC_Menu_Reinterlace1.jpg

Fields 0 & 1:
http://s18.postimg.org/isvz5hoah/DVDR3575_H_JVC_Menu_field0.jpg http://s18.postimg.org/6fj4ykym1/DVDR3575_H_JVC_Menu_field1.jpg

Frames 0 & 1:
http://s18.postimg.org/va2msnjg9/DVDR3575_H_JVC_Menu_f0.jpg http://s18.postimg.org/qk83qb321/DVDR3575_H_JVC_Menu_f1.jpg

For the purposes of easier detection, I can start all of my captures off with sharp text like this, or even pure noise from a disconnected TV tuner. But how do I go about scripting up a function to check the first few fields and pick the one that looks less-interpolated?

johnmeyer
27th January 2016, 20:35
Whatever it is you are doing, or trying to do, you will see zero difference on a static scene like your example. When the video doesn't move, there is not difference whatsoever between interlaced and progressive.

Your results have all sorts of chroma issues (red artifacts in white text). The script you posted will take 60p material and turn it into 60i, but I suspect, from the results, that you are doing something else to this video.

ChiDragon
28th January 2016, 01:33
Whatever it is you are doing, or trying to do, you will see zero difference on a static scene like your example. When the video doesn't move, there is not difference whatsoever between interlaced and progressive.
The HDMI source device is just running a dumb bob on the signal, hence the artifacts even on stills.

Save the first image (the clearest one) to a folder, and then run this script on it to see the difference between interlaced and bobbed progressive for yourself.

ImageSource("DVDR3575_H_JVC_Menu_Reinterlace0.jpg").AssumeTFF()

B = Bob()

StackHorizontal(B.Subtitle("Bob"),Interleave(B.Reinterlace(1).Subtitle("Reinterlace(1)"),B.Reinterlace(0).Subtitle("Reinterlace(0)")))

The script you posted will take 60p material and turn it into 60i, but I suspect, from the results, that you are doing something else to this video.
I assure you I am not.

Your results have all sorts of chroma issues (red artifacts in white text).
Yes. The original signal in this example is composite video from a VCR.