View Full Version : Suggestions for PAL film DVD with misaligned fields


wonkey_monkey
26th December 2016, 00:06
I've got a boxset of a 1980s BBC drama, shot on film, but when it was transferred to video it looks like the fields became misaligned - so what you end up with is unwanted interlacing:

http://i.imgur.com/lEIcNlf.png

(a crop from a single frame; both fields are from the same point in time)

What's a good way to handle this? I'm not averse to writing my own filter if necessary, but if there's an off-the-shelf solution I'd prefer to save my time.

There's also variation in brightness between some fields, and the misalignment isn't constant across the entire frame.

Here's a sample which shows the problem (not in all frames):

http://www.megafileupload.com/clnM/cut.demuxed.m2v

videoh
26th December 2016, 01:37
The fields are not misaligned. The fields that match in time are distorted relative to each other. You can see it by separating fields and stepping through. There should be a small vertical jump but not gross horizontal changes that are worse in the upper half of the frame, and which are backwards from the panning. It would be clean progressive as one would expect from film were it not for this distortion.

I don't know of any good solution to this. Probably just apply a decent adaptive deinterlacer. For example, DGSource(deinterlace=1) looks acceptable to me.

manono
26th December 2016, 07:20
With similar problems I just do a:

QTGMC().SelectEven ### or SelectOdd

and be done with it.

johnmeyer
26th December 2016, 17:58
Videoh did a good job describing what is going on. The only thing I have to add is that for those frame which are progressive (i.e., where both fields are from the same moment in time), the horizontal displacement in the top of the screen that he noted looks to me like what you would expect from a rolling shutter. The artifact created by a rolling shutter is that, when the camera pans horizontally as it does in your clip, vertical objects appear to "lean" forward or backwards (depending on the panning direction). That is exactly what I see, but only in the even fields, and only in some of them.

The other thing I have to add is that, since there are some frames which are actually interlaced (where the two fields are clearly not from the same moment in time), and since your video is 25 fps PAL, it makes me wonder if someone tried to do some sort of fps conversion, either from 24 fps to 25 fps, or from 30 fps back down to 25 fps, and did this conversion while also trying (badly) to do some sort of deinterlacing. Tough to tell.

In the end, without creating an extraordinarily difficult script which attempts to detect those frames which are interlaced and those which are not (TFM may be able to do this ...), and then using conditional logic to do different things to the progressive portions of the video, manono's suggestion is probably the best you can do.

Of course if you have access to the original footage, before the bad stuff was created, then by all means go back to that and start over. This does not look like something that came directly out of the camera.

wonkey_monkey
26th December 2016, 18:32
The other thing I have to add is that, since there are some frames which are actually interlaced (where the two fields are clearly not from the same moment in time)

There aren't. You might think they are, but there aren't! It's a native BBC production (the clip is straight from the DVD) so was definitely shot at 25fps. Rather than rolling shutter, it looks like it happened when the film was scanned/recorded to video, with the frame not held perfectly steady in the gate between the two fields being recorded.

The clip isn't the best way to see this, since it is just a pan, but there are other places where just as much interlacing is shown, but it can also be seen from the action that both fields are still of the same film frame.

qtgmc and overlaying selecteven and selectodd clips looks fairly good - it looks slightly better than just selecting one or the other, though it might induce too much blurring if the distortion between fields is too much.

I might have a go at writing a plugin to realign the fields (although the distortion may not be purely horizontal) anyway, but there would still be a variation of brightness to deal with.

Sharc
27th December 2016, 18:05
How about
QTGMC(preset="medium",InputType=2)
FieldDeinterlace(Full=true,dthreshold=4,map=false) #removes remaining combs, controlled by dthreshold.
Too blurry?

ndjamena
27th December 2016, 19:03
qtgmc
interframe(cores=1,FrameDouble=true)
selectevery(4,1)

I don't know if that helps any.

I figure it would be better than simply blending the two frames together.

wonkey_monkey
27th December 2016, 23:35
Thanks for the suggestions. Personally I quite liked qtgmc followed by a straight mix of the two reconstructed frames from fields, but it was a little slow.

I've written a plugin to realign fields, which works pretty well (though it could use more work to deal with varying alignment along a line), then a -1,2,6,2,-1 kernel takes care of any residual interlacing without doing much damage (it's all pretty soft to start with).

Ghitulescu
3rd January 2017, 15:11
Are you sure it was shot on film? All BBC movies, series and stuff look like they have been recorded straight to tape, then edited on tape, which was also far from perfect by today's standards.

If this is the case, then the original format was interlaced and in panning it will be difficult to "deinterlace" in a perfect manner.

ndjamena
3rd January 2017, 15:32
Are you sure it was shot on film? All BBC movies, series and stuff look like they have been recorded straight to tape, then edited on tape, which was also far from perfect by today's standards.

If this is the case, then the original format was interlaced and in panning it will be difficult to "deinterlace" in a perfect manner.

???

Pride and Prejudice had it's stock film footage transferred to Blu Ray, I have the 1080p Blu Ray sitting on my shelf.

The entirety of Doctor Who: Spearhead from Space was recorded on film, they managed to transfer that to Blu Ray as well.

Most of the old BBC TV shows I have shift between film and video scenes. I just did Yes Minister and it's sequel Yes, Prime Minster, Fawlty Towers... the filmed scenes are fairly obvious to see. Most old BBC television used at least some film footage stock, some of them used nothing else.

It's not much different to what happened in America, and I now have Star Trek TOS and TNG on Blu Ray.

wonkey_monkey
3rd January 2017, 20:45
This is one of the BBC's higher end dramas, and as such was shot entirely on film. The transfer to video looks like it was only done once for broadcast while the series was running in the 80s, so all of the transfers' faults remain on the DVD.

The first few episodes all seem to have their own unique problems. I'm currently looking at the third episode, which has fields out of sync with frames (mostly, easily fixed) but also has every frame blended slightly with the next one.

Any tips for handling that? So far I've tried subtracting some of the next frame, but then that leaves another ghost to deal with, so I have to add back in some of the n+2 frame. It actually works surprisingly well:

http://i.imgur.com/xTvAYgt.jpg
http://i.imgur.com/QHg9A1H.jpg

I can't think of any better way to handle it (problems including bright highlights leaving black holes when subtracted), but if anyone knows of one...