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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 27th August 2020, 00:16   #1  |  Link
VideoOnTapes
Registered User
 
Join Date: Aug 2020
Location: France
Posts: 4
Recolorization of black and white frames

Hi there,

I'm newbie with AviSynth. I use AviSynth+ 64bit and AvsPmod 2.6.3.4.

I'm looking to restore old VHS recordings where some frames are in black and white.
Something similar to what's been done here: https://www.youtube.com/watch?v=iaUsvKDQycg

I figured out how to do it with MergeChroma() :

Code:
frame_number_with_good_colors = 128
good_frame= clip.Trim(frame_number_with_good_colors,1)

# Apply MergeChroma for frames with bad chroma (AverageChromaU() < 120)
# Apply MergeChroma for frames in black and white (vPlaneMedian() = 127 or 128)
copy=clip
chromed=MergeChroma(clip, good_frame)
clip=ConditionalSelect(clip,"v_median=vPlaneMedian()"+chr(13) \
+ "av_chromaU=AverageChromaU()"+chr(13) \
+"(v_median==128 || v_median==127)?1:(av_chromaU<120?1:0)", copy, chromed)
What I'd like to do is use the color values from the last frame that is correct.
To do this, I need to store the number of this correct frame, as it has to be reused until a new frame with correct colors is found.

However, I can't store the current_frame value in a variable. Could you help me on this point?

Also, I tried to write this value to a file:

Code:
clip = clip.WriteFile("variable.txt", "current_frame")
but it doesn't work for me :
Quote:
Script error: Invalid arguments to function 'WriteFile'

NB: The video I'm working on (as a test basis) is this one:
https://www.youtube.com/watch?v=rX0r6WbiutU
VideoOnTapes is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.