So I went back to this, after it got stalled for a few more months (I know, I know...).
I got almost everything about right, except one thing that's been bugging me for hours yesterday — the end credits. When the credits start to appear — with egregious combing artifacts — the background video is still moving, until the first line reaches the top of the screen, at which point the credits continue to roll over a frozen frame. Processing the underlying video with TFM blurs it significantly and unnecessarily, so what I would like to do is to process the text area with TFM(), and leave the part of the frame above the text untouched, which means adjusting frame by frame which part of the frame gets processed (ideally with a seamless transition in-frame between the processed text area and the unprocessed video area), effectively resulting in a vertical “wipe” transition between the unprocessed clip and the processed clip. I figured that I could do that with either Animate() or ConditionalReader(), in combination with Overlay(), to dynamically change the cropping parameters for the unprocessed clip, but so far each of these attempts failed misebarly. From what I could read, Avisynth is generally a terrible tool when it comes to achieving that kind of effect. Is there any way to do that anyway ?
I tried with Animate :
## Error message : “initial and final video frame sizes must match” (only 1 match for a Web search with that specific expression, and not helpful at all ; I don't understand why it doesn't allow a variation of the frame size considering that it is used in combination with Overlay() and therefore the outcome of that clip should not have to conform to a constant frame size constraint, considering what has been stated in the aforementioned thread regarding Avisynth's smart processing ability)Code:VCred = V.Trim(139949,0) Animate(VCred, 139949, 140034, "Crop", \ 0, 0, 0, 568, \ 0, 0, 0, 76) VCredCrop = last VCredTFM = VCred.TFM(cthresh=-1) VCredOver = Overlay(VCredTFM, VCredCrop)
...and ConditionalReader :
...with a “yoffset.txt” file containing the following :Code:VCred = V.Trim(139949,0) VCredCrop = VCred.Crop(0, 0, 0, bottom) ConditionalReader("yoffset.txt", "bottom", false) VCredTFM = VCred.TFM(cthresh=-1) VCredOver = Overlay(VCredTFM, VCredCrop)
## Error message : “I don't know what 'bottom' means” (also tried with “myvar”, to no avail, although it is stated on the dedicated page : “Note the ConditionalReader line comes after any use of myvar in the script”)Code:Type int Default 0 I 139950 140034 568 76
Yet another method would be to use a mask over the unprocessed clip (ideally with a blurred edge so as to get a seamless in-frame transition) and “lift” it gradually, but I wouldn't know how to go about doing something like this.
Note : I had to set “cthresh=-1” so that it would process the very first frame where the credits appear at the bottom.
Screenshot :
[Attachment 59377 - Click to enlarge]
Video sample :
VTS_01_1 1h33m18s.demuxed.m2v
+ Reply to Thread
Results 1 to 7 of 7
-
Last edited by abolibibelot; 29th Oct 2021 at 07:58.
-
Why not something like:
Code:Mpeg2Source("VTS_01_1 1h33m18s.demuxed.d2v", Info=3) p1 = Trim(0,329) p2 = Trim(330,0).QTGMC(FPSDivisor=2) p1+p2
Code:Mpeg2Source("VTS_01_1 1h33m18s.demuxed.d2v", Info=3) p1 = Trim(0,329).SelectEvery(1,0,0) p2 = Trim(330,0).QTGMC() p1+p2
-
I think this is what you were originally trying to do:
Code:function ScrollOverlay(clip c1, clip c2, int ypos) { patch=Crop(c2, 0, ypos, -0, -0) Overlay(c1, patch, x=0, y=ypos) } Mpeg2Source("VTS_01_1 1h33m18s.demuxed.d2v", Info=3) s = ConvertToYV24() q = s.QTGMC(FPSDivisor=2) # titles start scrolling at frame 330 and reach the top at frame 428 p1 = s.Trim(0, 329) p2 = Animate(330,428, "ScrollOverlay", s,q,568, s,q,0).Trim(330,428) p3 = q.Trim(429,0) p1+p2+p3
Code:source = Mpeg2Source("VTS_01_1 1h33m18s.demuxed.d2v", Info=3) q = source.QTGMC(FPSDivisor=2) bwmask = StackVertical(BlankClip(source, color=color_black), BlankClip(source, color=color_white)).ColorYUV(cont_y=50).ConvertToY8() # titles start scrolling at frame 330 and reach the top at frame 428 smask = Animate(328,428, "Crop", bwmask,0,0,0,source.height, bwmask,0,576,0,source.height) scroll = Overlay(source, q, mask=smask) p1 = source.Trim(0,329) p2 = scroll.Trim(330,428) p3 = q.Trim(429,0) p1+p2+p3
Last edited by jagabo; 29th Oct 2021 at 16:15.
-
Why not something like:
[QTGMC]
2) In my tests, QTGMC produced a definitely inferior result for that particular sequence, as I had mentioned in the aforementioned thread it seemingly treats the snow as noise and attempts to “clean” it or “stabilize” it through its motion estimation magic, resulting in an artificial aspect (I didn't play with the presets or specific settings to see if it would improve the outcome) ; there's no such effect with TFM's own post-processing or with nnedi3.
Why converting to YV24 ? (Not allowed with TFM.)
I think this is what you were originally trying to do:
[ScrollOverlay / sliding mask]
Is it possible with Avisynth to create a mask with a smooth gradation from black to white, over ~20 pixels for instance ?
What is the purpose of .ColorYUV(cont_y=50) and .ConvertToY8() ?
I'll have to do some further testing with Animate to understand why my attempt didn't work as expected. -
Yes, but who cares? It's only snow in the closing credits.
In the scripts with cropping the scrolling results in some odd Y values -- that doesn't work in YV12. You could alternatively use YUY2.
One easy way to do that is vertically downscale the mask the scale it back up to the original size. Something like BilinearResize(width, height/16).BicubicResize(width,height). The blurry transition may let some of the interlaced titles bleed through so you may have to move it up a bit.
BlankClip() will produce black at Y=16, and whites Y=235. Since this is being used as a mask we wan blacks at Y=0, whites at Y=255. And the original clip was YV12 -- the mask needed to be converted to a non-y--chroma-subsampled format for scrolling (again, odd values not allowed with YV12).Last edited by jagabo; 31st Oct 2021 at 09:47.
-
Another approach is to use a color mask to limit QTGMC to just the yellow text.
Code:Mpeg2Source("VTS_01_1 1h33m18s.demuxed.d2v", CPU2="ooooxx", Info=3) src = last q = QTGMC(FPSDivisor=2) cmask = q.MaskHS(StartHue=155, EndHue=170, MinSat=10).mt_expand().mt_expand().Blur(1.4) cmask = Overlay(cmask, cmask, y=-2, mode="add").BilinearResize(src.width, src.height) Overlay(src, q, mask=cmask)
Similar Threads
-
Help on figuring out field order issue on this clip (avisynth, UTvideo)
By nicholasserra in forum Video ConversionReplies: 0Last Post: 11th Dec 2020, 22:11 -
Create a function in Avisynth to apply a logo on a clip
By kaskaï in forum EditingReplies: 1Last Post: 9th Apr 2020, 09:03 -
AVISynth and TIVTC/TFM chokes on this clip, but why?
By SaurusX in forum Video ConversionReplies: 5Last Post: 8th May 2018, 16:06 -
Star Wipe in Avisynth?
By videeo in forum EditingReplies: 12Last Post: 23rd Mar 2018, 23:15 -
White line wipe effect in Vegas?
By HeyItsDaniel in forum Newbie / General discussionsReplies: 5Last Post: 16th Aug 2017, 11:03