1 2
5 6 7 8 9
Editor, Experienced player (852)
Joined: 8/12/2008
Posts: 845
Location: Québec, Canada
Pardon me if this isn't really on-topic but: http://www.youtube.com/watch?v=6gxWo3AMUGo "The clip was interpolated to 3840fps (64x speed), and then a number of frames around the originals were blended together. Finally half of them were dropped for 30fps." What do you guys think of this method? I think it looks really nice, but maybe that's not a good way to get rid of the flicker for the runs on the site?
Publisher
Joined: 4/23/2009
Posts: 1283
Does Super Smash Brothers Melee have 60 Hz flicker? I also don't get why 3840 FPS. In the end it's still 30 FPS.
Brandon
He/Him
Editor, Player (190)
Joined: 11/21/2010
Posts: 913
Location: Tennessee
Honestly, I think all runs should be encoded with TASBlend until YouTube supports true 60fps encodes. It would give the most accurate depiction of what the user would see if he / she ran the run on an emulator.
All the best, Brandon Evans
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
It's a really subtle effect. It doesn't seem to be done for flicker effects. I don't think most viewers will notice an improvement - in fact it looks worse because details are smeared together. (EDIT: There are almost no stars in the background of the motion-blurred clip.)
Active player (276)
Joined: 4/30/2009
Posts: 791
Looking over the blended Alisia Dragoon TAS again, I notice there are parts where the flicker appears as it does in game, but much of it where it does not. Between 7:50 and 8:20 of the encode, the flashing of the charged Thunder in the top left looks correct. Would there be any way to find out what is different to the rest of the video where there is more blurring there, and apply it correctly throughout the encode? I suspect getting the right timing would also fix the flickering on enemies that warp in, as well.
Brandon
He/Him
Editor, Player (190)
Joined: 11/21/2010
Posts: 913
Location: Tennessee
30hz flicker is not the only reason that TASBlend would be useful. When you encode in 30fps normally, frames have to be cut out, regardless of whether not they are important. If a frame and its successor were identical, then the blending would result in the original frame, and no blurring would happen. Always using TASBlend ensures that no frames are lost, and I think choppiness is worse than blurriness.
All the best, Brandon Evans
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
This is the problem with encoding being extremely subjective. The only solution I'd be able to think of would be to produce multiple encodes, but going by past experiences, that is not going to happen.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Toothache wrote:
Looking over the blended Alisia Dragoon TAS again, I notice there are parts where the flicker appears as it does in game, but much of it where it does not. Between 7:50 and 8:20 of the encode, the flashing of the charged Thunder in the top left looks correct. Would there be any way to find out what is different to the rest of the video where there is more blurring there, and apply it correctly throughout the encode? I suspect getting the right timing would also fix the flickering on enemies that warp in, as well.
Assuming that it can be fixed (flicker starts at the "wrong" frame or something like that) you'd have to do that by going through the clip frame-by-frame and adding instructions to your script that fix the issue.
Editor, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
There is one problem with TASBlend. It increases jerkiness. Simple frame dropping from 60Hz to 30Hz works like this: drop TAKE drop TAKE drop TAKE drop TAKE drop TAKE drop TAKE ... where drop=0% blend and TAKE=100% blend. TASblend works like this: low HIGH HIGH low low HIGH HIGH low low HIGH HIGH low low HIGH ... where low=33% blend and HIGH=67% blend. The low-blends are mostly unnoticeable at most situations. Which means, instead of the jerkiness being caused by one frame dropped, now two frames are dropped. It's an inchworm effect. Fast,slow,fast,slow,fast,slow... I don't think I am expressing clearly here, but the concern is that this just substitutes one kind of jerkiness for another kind of jerkiness, and that it might still look bad.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Well, there has to be a trade-off somewhere. It would be possible to use the sequence [67;33][67;33][67;33][...], but the flickering objects would look different depending on what frame the effect starts (even or odd). Which might also be fixable, but only manually:
AVISource(...)

shifted = DuplicateFrame(0).Blend_67_33
Blend_67_33
Replace(100, 200, shifted)
# ...




function Blend_67_33(clip c)  {
        c
        Layer(SelectEven, SelectOdd, level=round(1.0/3.0 * 257))
}
(Replace is here)
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
Also with the non-alternating blending it wouldn't actually look like flicker, but just transparency (either 66% or 33% transparency depending on whether it's on at even or odd frames). OTOH even that's better than the sprite simply disappearing (or looking normal).
Emulator Coder, Skilled player (1141)
Joined: 5/1/2010
Posts: 1217
Bisqwit wrote:
There is one problem with TASBlend. It increases jerkiness.
At least with some games, it seems to reduce jerkiness. In case of Alien Carnage, first dropping frame rate to 60fps via hard frame dropping and then doing TASBlend seems to give fairly smooth (if bit blurred) results, while hard drop down to 30fps seems to produce jerky video.
Editor, Skilled player (1939)
Joined: 6/15/2005
Posts: 3247
A few days ago, I experimented with frame-blending on Mega Man X (same portion of the clip that Mister Epic used). I found both [67/33][33/67] and [67/33] to be too blurry for my liking, and [67/33][33/67] is jerky. Without accounting for any flicker effects, I found that somewhere between [75/25] and [83/17] was a better tradeoff between blur and 30Hz motion (for Mega Man X). Of course, trying to account for flicker goes against this. There really isn't any good solution I can think of. Note that Mega Man X uses 15Hz blinking for bosses; this explains the two-typed flicker even in TASBlend. I suppose you could counter this by using [67/33][50/50][33/67] or [33/67][50/50][67/33], but this will still result in two-typed flicker (though not as obvious) which has an even longer period (3 times as long as TASBlend), and the motion is only slightly less jerky and even more blurry. Or you could use [67/33][67/33][33/67][33/67]. But this isn't foolproof either.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
15Hz blinking would be quite visible on a real TV screen too, right?
Player (136)
Joined: 9/18/2007
Posts: 389
Someone on IRC had the following idea: take odd lines from frame 1, merge with even lines from frame 2 ---> frame 1 take even lines from frame 3, merge with odd lines from frame 4 ---> frame 2 ... and so on. I tested how it looks like, but it wasn't good. I did the following: take line 1 from frame 1, line 1 from frame 2, line 2 from frame 1, line 2 from frame 2, line 3 from frame 1, line 3 from frame 2, ... -> frame 1 take line 1 from frame 4, line 1 from frame 3, line 2 from frame 4, line 2 from frame 3, line 3 from frame 4, line 3 from frame 3, ... -> frame 2 (blackwhite-test.png is a 1x224 picture consisting of a white pixel followed by a black pixel followed by a white pixel followed by a black pixel ...) That's the AVIsynth code to do that (given the input video is 256x224)
original = AVIsource("test-blend.avi").pointresize(256,448).killaudio()
even = original.selecteven()
odd = original.selectodd()
maskclip1 = ImageReader("blackwhite-test.png",1,10000,30).pointresize(256,224)
maskclip = stackvertical(maskclip1, maskclip1)

temp1 = even.overlay(odd, mask=maskclip, opacity = 0.7)
temp2 = odd.overlay(even, mask=maskclip, opacity = 0.3)
return interleave(temp1.selecteven(), temp2.selectodd())
What do you think about the result for 70% / 30% or the result with 100% / 100% with deinterlacer ?
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
partyboy1a wrote:
Someone on IRC had the following idea: take odd lines from frame 1, merge with even lines from frame 2 ---> frame 1 take even lines from frame 3, merge with odd lines from frame 4 ---> frame 2 ... and so on. I tested how it looks like, but it wasn't good. I did the following: take line 1 from frame 1, line 1 from frame 2, line 2 from frame 1, line 2 from frame 2, line 3 from frame 1, line 3 from frame 2, ... -> frame 1 take line 1 from frame 4, line 1 from frame 3, line 2 from frame 4, line 2 from frame 3, line 3 from frame 4, line 3 from frame 3, ... -> frame 2 (blackwhite-test.png is a 1x224 picture consisting of a white pixel followed by a black pixel followed by a white pixel followed by a black pixel ...) That's the AVIsynth code to do that (given the input video is 256x224)
original = AVIsource("test-blend.avi").pointresize(256,448).killaudio()
even = original.selecteven()
odd = original.selectodd()
maskclip1 = ImageReader("blackwhite-test.png",1,10000,30).pointresize(256,224)
maskclip = stackvertical(maskclip1, maskclip1)

temp1 = even.overlay(odd, mask=maskclip, opacity = 0.7)
temp2 = odd.overlay(even, mask=maskclip, opacity = 0.3)
return interleave(temp1.selecteven(), temp2.selectodd())
What do you think about the result for 70% / 30% or the result with 100% / 100% with deinterlacer ?
Is this what the code should look like? Movement looks too jumpy, imo.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11271
Location: RU
How do I pack the above functions into a proper script? While previewing partyboy1a's script in VirtualDub with deinterlace filter at Yadiff mode, keep bottom, I got perfect picture with 15 FPS flicker instead of 30. Both video & blinking rates were reduced by two. Hell yeah, this looks very much like on TV! EDIT: Now blinking totally depends on what frame it starts at. It may appear almost invisible in some places of the movie and good in others.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
That looks great. It makes the blinking happen on every other frame (15Hz in a 30Hz video)! This is probably the best we can do.
Senior Moderator
Joined: 8/4/2005
Posts: 5770
Location: Away
Well, if it only makes it work if the blinking happens on odd frames and not even (or the other way around), then it's definitely not the best yet. But I agree, the example above looks nice.
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11271
Location: RU
The only thing I can imagine to solve that is to delete one frame before the blinking, if it starts from "wrong frame". When I tried keeping top line for deinterlacing this vid, it started looking really blended between frames, though the scrolling looked more gradual than on my gif above. And the blinking on the other place in this movie looked proper. Will post examples here. EDIT: The above gif was made at keep bottom field mode (1:1 ratio). Here's how it looks with top field & 0.5:0.5 ratio: And here's a comparison of another problematic place. Keep bottom looks the same at any ratio: Keep top with 0.7:0.3 ratio: And finally with 0.5:0.5 rastio:
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (136)
Joined: 9/18/2007
Posts: 389
That's somewhat funny... your results appear to be better than mine. If the problem is that the blinking doesn't work as good as it should, you might use the same idea twice:
LoadCplugin("yadif.dll")

original = AVIsource("test-blend.avi").pointresize(256,448).killaudio() 
even = original.selecteven() 
odd = original.selectodd() 
maskclip1 = ImageReader("blackwhite-test.png",1,10000,30).pointresize(256,224) 
maskclip = stackvertical(maskclip1, maskclip1) 

temp1 = even.overlay(odd, mask=maskclip, opacity = 0.7) 
temp2 = odd.overlay(even, mask=maskclip, opacity = 0.3) 
firstresult = interleave(temp1.selecteven(), temp2.selectodd()).converttoyv12().yadif(order=1)

original2 = original.deleteframe(0)
even2 = original2.selecteven() 
odd2 = original2.selectodd() 
temp2_1 = even2.overlay(odd2, mask=maskclip, opacity = 0.7) 
temp2_2 = odd2.overlay(even2, mask=maskclip, opacity = 0.3) 
secondresult = interleave(temp2_1.selecteven(), temp2_2.selectodd()).converttoyv12().yadif(order=1)

return firstresult.pointresize(256,896).overlay(secondresult.pointresize(256,896), mask=stackvertical(maskclip,maskclip)).yadif(order=1)
This isn't looking good enough for my test movie, it's still not better than a simple 20fps encode... but the GIFs you made looked quite good.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11271
Location: RU
Yadif can't be loaded, error 0x7e. Does it work with 2.6a?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
You need to put yadif.dll in a separate directory, then put "yadif.avsi" into the plugins directory which contains the line
LoadCPlugin("path_to_separate_directory\yadif.dll")
There are some problems with the code though... - it results in a 256x896 clip - Yadiv also works with YUY2, which is slightly better - temp2_1 and temp2_2 are unused - there's no need for an external image
AVISource("00.avi", audio=false)
PointResize(Width, Height * 2)
ConvertToYUY2
src = last

even     = SelectEven
odd      = SelectOdd
MaskClip = Get_BlackWhitePattern(Width, Height)
temp1    = even.Overlay(odd , mask=MaskClip, opacity=0.7).SelectEven
temp2    = odd .Overlay(even, mask=MaskClip, opacity=0.3).SelectOdd
result1  = Interleave(temp1, temp2.SelectOdd).Yadif(order=1).PointResize(256, 896)

src.DeleteFrame(0)
even2    = SelectEven
odd2     = SelectOdd
temp2_1  = even2.Overlay(odd2 , mask=MaskClip, opacity=0.7)
temp2_2  = odd2 .Overlay(even2, mask=MaskClip, opacity=0.3)
result2  = Interleave(temp1, temp2).Yadif(order=1).PointResize(256, 896)

Overlay(result1, result2, mask=StackVertical(MaskClip, MaskClip)).Yadif(order=1)




function Get_BlackWhitePattern(int xRes, int yRes)  {
        BlankClip(10000, xRes, 1, "YUY2", 30, color=$FFFFFF)
        Add_BlackWhiteLines(yRes)
}


function Add_BlackWhiteLines(clip c, int yRes)  {
        return (c.Height==yRes)  ?  c  :  ((c.Height % 2) == 0)  ?  c.AddBorders(0, 0, 0, 1, $FFFFFF).Add_BlackWhiteLines(yRes)
        \                                                        :  c.AddBorders(0, 0, 0, 1, $000000).Add_BlackWhiteLines(yRes)
}
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Just saw these comments on Youtube...
MUGG wrote:
So this is the first time I see the blurrying caused by TASblend. I think my simple 25 FPS solution was better since it was almost unnoticeable.
I think 25 FPS just causes too much jerky motion - the less frames omitted, the better. Besides, blur occurs normally too, even on handhelds (e.g. Link's Awakening credits).
Brandon wrote:
I've defaulted to using TASBlend on all of my new encodes regardless to flicker.
If the games don't use 30Hz flicker and if there are no other sprite flickering problems (too many sprites per line) then it's better to just drop every other frame. Looks cleaner and reduces the file size. There's a sample script on the TASBlend page that shows how to apply the effect only to hand-selected sections.
Player (136)
Joined: 9/18/2007
Posts: 389
oops, there were some errors in my initial code... This clip really has this awkward solution, but it doesn't seem to make the encode significantly larger... The best solution for the flicker would be to drop every other frame, but beforehand, force the game into producing 15Hz flicker... Let's say the flicker problem only occurs on the sprite layer, and the sprite layer is drawn on top of all others, and there are no effects applied afterwards. Then some Lua script could read the sprite data, and try to detect flicker. When 30Hz flicker starts on an odd frame (let's say frame 1 it's visible, frame 2 invisible), it would let frame 1 untouched, add the sprite to frame 2, and delete the sprite from frame 3, and let frame 4 untouched, let frame 5 untouched, add the sprite to frame 6, ... Ideally it would be added exactly on the right location by the game's logic. If now every even or odd frame is taken, the flicker is now 15Hz. Well... that is not only console-dependent, but even game-dependent, this would definitely be too much work for encoders.
1 2
5 6 7 8 9