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. |
|
|
#1 | Link |
|
Registered User
Join Date: Nov 2009
Posts: 50
|
Apply a Filter at Regular Intervals
I have a clip where when I IVTC it the chroma gets messed up every 4th frame. For some reason it includes the chroma from the previous frame.
I added the following line to my script; mergechroma(selectevery(1,1)) This fixes the frames where the errant chroma is introduced, but obviously screws up all the previously good ones. What's my best method of applying the above line but tell it to only occur every 4th frame? I messed around with the "selectevery" portion of the line, but the slightest change would introduce chroma from all manner of frames. I really need to find an idiots guide to avisynth filter use/syntax, lol. |
|
|
|
|
|
#2 | Link |
|
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 720
|
Code:
fixed = mergechroma(selectevery(1,1)) Interleave (last, fixed) SelectEvery (8, 0, 2, 4+1, 6)
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
|
|
|
|
|
#3 | Link | |
|
Registered User
Join Date: Nov 2009
Posts: 50
|
Quote:
Just so I can learn from this, what do the 8, 0, 2, 4+1 and 6 represent. I take it the 4+1 is the frame multiple the filter is being applied to. Sorry to be a pain, but I'd like to understand rather than just beg for help ![]() Thanks |
|
|
|
|
|
|
#4 | Link |
|
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 720
|
I interleaved the original clip and the fixed clip. Therefore the even frames are the original ones and the odd frames the fixed ones. Each group of 4 frames result in a group of 8 frames. Then we just have to pick 4 frames per group of 8, the original or the fixed frame in each pair. In my example:
Code:
Original: … a b c d … Fixed: … A B C D … -- Interleave -> … a A b B c C d D … 0 1 2 3 4 5 6 7 ^ ^ ^ ^ -- SelectEvery -> … a b C d …
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
|
|
|
|
|
#6 | Link |
|
Registered User
Join Date: Nov 2009
Posts: 50
|
Hmmm... it doesn't seem to be working.
I mean, it is moving chromas around, but I can't get it to apply to the fields I want. Should I add this before or after the IVTC? and also I forgot that I added a trim function to the end, which is why it looked to me that it started on frame 4 and repeated every 4 frames, but in actual fact (after IVTC) it starts on frame 2. I'm getting so confused. Here's the original script that when opened in Virtualdub shows the dodgy chroma every 4 frames. If I get rid of the Trim function, and I skip past all the opening gumph to the actual movie, it still shows the chroma problem every 4 frames. Calculating backwards leads me to the problem first appearing on frame No 2. Code:
#Audio
A=NicAC3Source("F:\Main Movie\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3")
#Video
V=DGDecode_mpeg2source("F:\Main Movie\VTS_01_1.d2v", info=3)
#Merge
Audiodub(V,A)
AssumeBFF()
TFM()
tdecimate(mode=1)
#Subs
VobSub("F:\Main Movie\VTS_01_0.idx")
#Trim
__film = last
__t0 = __film.trim(498, 115250)
__t0
Code:
#Audio
A=NicAC3Source("F:\Main Movie\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3")
#Video
V=DGDecode_mpeg2source("F:\Main Movie\VTS_01_1.d2v", info=3)
#Merge
Audiodub(V,A)
AssumeBFF()
TFM()
tdecimate(mode=1)
fixed = mergechroma(selectevery(1,1))
#Subs
VobSub("F:\Main Movie\VTS_01_0.idx")
#Trim
__film = last
__t0 = __film.trim(498, 115250)
__t0
Obviously I'd rather not do any more passes than necessary, but it's driving me bonkers at this point. |
|
|
|
|
|
#7 | Link |
|
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Temporarily Subtitle the fixed version and comment out the SelectEvery. Examine the double rate clip to determine the pattern you need to achieve your desired result. This is called stepwise debugging of your script.
Code:
#Audio
A=NicAC3Source("F:\Main Movie\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3")
#Video
V=DGDecode_mpeg2source("F:\Main Movie\VTS_01_1.d2v", info=3)
#Merge
Audiodub(V,A)
AssumeBFF()
TFM()
tdecimate(mode=1)
fixed = mergechroma(selectevery(1,1)).Subtitle("Fixed")
Interleave (last, fixed)
# SelectEvery (8, 0, 2, 4+1, 6)
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|