Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
29th October 2013, 03:01 | #1 | Link |
Registered User
Join Date: Mar 2009
Posts: 39
|
VHS Horizontal Lines: ReplaceFrameAvg()
Hello,
[Similar topic with no solution] So I have a video sourced from VHS tape recorded in a TV studio. Every minute or so, for 1-5 frames, horizontal white lines appear on the clip and distort the image in those places. What I have been doing is DeleteFrame() on each of these, until I realized that this does not sync audio, so I defined: Code:
function DeleteFrame2(clip clp, int framenumber) { return clp.trim(0,framenumber-1) + clp.trim(framenumber+1,0) } I was thinking it would be ideal if I could somehow repair these with a ReplaceFrameAvg() function, which takes the average of the frame before and the frame after. Any ideas? |
29th October 2013, 13:49 | #2 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
A simpler solution would be just to use FreezeFrame().
However, your request could be done as follows: Code:
function ReplaceFrameAvg(clip c, int f) { # Note: assumes 0 < f < frameCount-1 avg = Merge(c.SelectEvery(1,-1), c.SelectEvery(1,1)) c.Trim(0, -f) + avg.Trim(f, -1) + c.Trim(f+1, 0) AudioDub(c) # preserve audio } |
30th October 2013, 18:21 | #3 | Link |
Registered User
Join Date: Feb 2013
Posts: 23
|
Yes AviUser, there are hundreds ways to what you want. As Gavino mentioned freezeframe is one method. You could also delete the bad frame, then duplicate the previous one. If you don't want to spend so much time manually checking frames, you could use a temporal denoiser. Or even better, you could use a motion compensated temporal denoiser. Or you could learn how to use the DeScratch/DeSpot filters in combination with DePanEstimate (or mvtools). Although DeScratch/DeSpot results may vary because the settings can be difficult to configure.
|
9th November 2013, 23:01 | #5 | Link |
Registered User
Join Date: Mar 2009
Posts: 39
|
Just to let you know the results when I applied your tips to a real video:
1. ReplaceFrameAvg() is the best, except causes ghost-like effects when there is movement and doesn't work when there are horizontal lines in two consecutive frames 2. I prefer FreezeFrame() over DeleteFrame2() because no audio blips will be introduced and it won't really increase the size of the video (identical frames compress well) |
Thread Tools | Search this Thread |
Display Modes | |
|
|