Posts for creaothceann


creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Call this with 25.0/100; leaving out the parameter will revert to 66:33.
function TASBlend(clip c, float "ratio")  {
        # reduces framerate to 1/2 but leaves flicker effects partly visible
        # blends frame pairs with alternating opacity (default is 2/3+1/3;1/3+2/3)
        # optional "ratio" is the opacity of the first frame out of the four
        ratio    = default(ratio, 2.0 / 3)
        opacity1 = round((1 - ratio) * 257)
        opacity2 = round((    ratio) * 257)
        c
        Interleave(Layer(SelectEvery(4, 0), SelectEvery(4, 1), level=opacity1),
        \          Layer(SelectEvery(4, 2), SelectEvery(4, 3), level=opacity2))
}
sgrunt: Could you change part of the TASBlend page, please? "creaothceann suggests using this in the following fashion to select only certain segments of the clip for blending" -> "If only certain segments of the clip are to be blended, creaothceann suggests using this in the following fashion"
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
What about Wine?
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Alright. bsnes has the problem that the framerate of the real SNES is not exactly 60 fps so it needs some adjustment of the audio rate (SNES9x 1.53 also uses 31900 as the default); I thought this problem was related.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
There's a bit more to the Youtube issue, but I'm not sure if it would belong to the page... Some emulators emulate their system not at exactly 60.0 fps. For example SNES9x v1.43 rr17 uses 60.038, but still sets the AVI framerate to 60/1. This causes the video to lag behind the audio, which becomes noticeable in long movies (>15 minutes). It can be fixed by... 1. Setting the framerate to the correct value. But after TASBlend or ChangeFPS it's still larger than 30.0 so Youtube drops frames or halves the framerate again (not sure which one it does now). 2. Slowing the audio down a tiny bit: TimeStretch(rate=100.0 * 60.0 / 60.038) The latter option is completely unnoticeable and leaves the video intact.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
I see. Thank you for the answers. :)
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Why is dedup needed btw? Identical frames would be caught by the codec.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
PreddY wrote:
very nice hack and very entertaining run, only flaw for me are the missing bosses :(
There would have to be a category "perfects all expected situations", i.e. any% with no sequence breaking, focusing simply on speed, energy management and overwhelming the enemies.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Please mention the emulator and ROM version when posting movies. ;)
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Brandon, that YT encode is quite jerky... Try this. EDIT: AdjustAudio isn't required if the emulator's sample rate is set to 48000. Fix_HUD removes the flickering but adds one black line to the HUD.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Warp wrote:
It plays like at 2 FPS
Same here; it's probably recorded that way. I have a quite beefy system imo - AMD Phenom X6 @ 2.8GHz, 8 GB RAM, DSL 16MBit/s.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
4matsy wrote:
just use the raw output from the emulator
Even if it's 512x224?
4matsy wrote:
NES games, for example, look a lot crisper and clearer nowadays on emulators than they do on an actual NES and NTSC TV through that nasty-ass field of grainy artifacts.
Metroid, for example, looks better imo at 4:3. And Kirby's Dreamland 3 pretty much requires a TV filter. Filters are great! http://i.imgur.com/BJTE9.jpg (src) http://www.reddit.com/r/gaming/comments/hqpp2/sexy_dot_pixel_shader/ http://i.imgur.com/nJsDR.png http://www.reddit.com/r/gaming/comments/hess7/smw/
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Normally you can use ApplyRange (though not in this case), but I prefer this solution:
AVISource("video.avi")

blended = TASBlend
ChangeFPS(FrameRate / 2)

Replace(  500,   999, blended)
Replace( 2000,  2999, blended)
Replace(70000, 71999, blended)
...




function Replace(clip c, int i, int j, clip d)  {
        Assert(i >= 0, "Replace: parameter i is negative")
        Assert(j >= 0, "Replace: parameter j is negative")
        p1 = c.Trim(0    , -i)
        p2 = d.Trim(i    ,  j)
        p3 = c.Trim(j + 1,  0)
        p1 = (i == 0)  ?  c.Trim(0, -1).DeleteFrame(0)  :  p1
        p3 = (j == 0)  ?  c.Trim(0, -1).DeleteFrame(0)  :  p3
        p1 + p2 + p3
        return (c.HasAudio)  ?  last.AudioDub(c)  :  last
}
Makes it easier to insert lots of changes (less typing). Mister Epic: Yeah I noticed it; you could also put the "c" on its own line before the Interleave call, and the "int()"s are no longer necessary.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Warp wrote:
From the perspective of the original consoles, take also into account that TV sets were also 30 FPS (in NTSC systems) or 25 FPS (in PAL systems). The game switching the visibility of a sprite on each frame (in other words the visibility flag changing 60 times per second on NTSC) wouldn't have caused the sprite to flicker on screen. It would have caused the sprite to be seen only on each other scanline (because TVs use interlacing). There would have not been a visible flicker.
I'm not sure if the flickering would be completely invisible, but it's not true that console games are interlaced (most of the time). Normally a TV draws every second line, then shifts the vertical position a bit and draws every odd line. The video signal controls when this happens. If consoles (such as the SNES in their default "progressive" mode) reset the position after every half-frame, the odd lines are drawn over the even lines and you get a 60fps picture with halved resolution and black scanlines.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Here's another function. It has no blurring at all, but creates jerky scrolling and movements. This shows the source and the functions:
AVISource("clip.avi").ConvertToRGB32

PointResize(Width * 2, Height * 2)
v1 = last                       .Subtitle(       "source:  60 fps")
v2 = SimpleBlend  .ChangeFPS(60).Subtitle(  "SimpleBlend:  f0=50% + f1=50%")
v3 = TASBlend     .ChangeFPS(60).Subtitle(     "TASBlend:  f0=66% + f1=33%;  f2=33% + f3=66%")
v4 = TASInterleave.ChangeFPS(60).Subtitle("TASInterleave:  f0;  f1  [f2;  f3]")
StackVertical(StackHorizontal(v1, v2),
\             StackHorizontal(v3, v4))




function SimpleBlend(clip c)  {
        c
        Layer(SelectEven, SelectOdd, level=128)
}


function TASBlend(clip c)  {
        c
        Interleave(Layer(SelectEvery(4, 0), SelectEvery(4, 1), level=round((2.0 / 3) * 257)),
        \          Layer(SelectEvery(4, 2), SelectEvery(4, 3), level=round((1.0 / 3) * 257)))
}


function TASInterleave(clip c)  {
        c
        Interleave(SelectEvery(4, 0),
        \          SelectEvery(4, 1))
}
Aktan wrote:
If it is 30.050, then AssumeFPS will make the A/V desync. It should probably be ChangeFPS instead.
Well, I prefer to leave the video as it is and change the audio instead (via TimeStretch).
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Just remembered something...
  • Put an "info" at the end of your script to see if the clip is exactly 30 fps and not something like 30.050. Put an "AssumeFPS(30)" there if necessary.
  • Also check at the end of the clip if the audio is still synchronized to the video.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Speaking of that, x264vfw might be useful for beginners.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
If it becomes possible, N might be a nice game to watch. :)
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Mister Epic wrote:
The AVS script for this clip is here.
If you're using ConvertToRGB32, it's best to do it right away. ;)
Dada wrote:
Looks a lot better than I expected. Though, it would be nice to have another example that uses a bit more scrolling at higher speeds.
Gimmick and Yoshi's Island are games where I noticed the motion blur being distracting (at 50%). Will try that myself...
DarkKobold wrote:
A quick question - all of this seems to be based on the fact that youtube... sucks. Seriously, seriously, sucks.
If the player supports 60 fps then frame blending isn't required, of course.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
function TASBlend(clip c)  {
        Interleave(Layer(SelectEvery(4, 0), SelectEvery(4, 1), round(2.0 / 3 * 257))
        \          Layer(SelectEvery(4, 2), SelectEvery(4, 3), round(1.0 / 3 * 257)))
}
Short version :)
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Yeah it's the better of the two variants, imo...
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
There's even a video dumping function already in SSNES.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Sorry, it needs an integer. >_>
function Blend(clip c1, clip c2, float opacity)  {Layer(c1, c2, level=int(opacity * 257))}


AVISource(...)
ConvertToRGB32
...
It should work with 257; if not, try 256. Overlay works internally in YUV colorspace, but the difference is negligible here.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Kuwaga wrote:
@Flygon: How would it be impossible if you let a modified version of the emulator (or maybe LUA) do it?
You're assuming that hardware sprites are used only for moving objects and hardware BGs for static backgrounds. Anyway...
function Blend(clip c1, clip c2, float opacity)  {Layer(c1, c2, level=opacity)}


AVISource(...)
src = last

f0 = SelectEvery(4, 0)
f1 = SelectEvery(4, 1)
f2 = SelectEvery(4, 2)
f3 = SelectEvery(4, 3)
a  = Blend(f0, f1, 1.0 * 2/3)
b  = Blend(f2, f3, 1.0 * 1/3)
pattern_33_66__66_33 = Interleave(a, b)

src
f0 = SelectEvery(8, 0)
f1 = SelectEvery(8, 1)
f2 = SelectEvery(8, 2)
f3 = SelectEvery(8, 3)
f4 = SelectEvery(8, 4)
f5 = SelectEvery(8, 5)
f6 = SelectEvery(8, 6)
f7 = SelectEvery(8, 7)
a  = Blend(f0, f1, 1.0 * 2/3)
b  = Blend(f2, f3, 1.0 * 1/2)
c  = Blend(f4, f5, 1.0 * 1/3)
d  = Blend(f6, f7, 1.0 * 1/2)
pattern_33_66__50_50__66_33__50_50 = Interleave(a, b, c, d)


pattern_...     # select one
This should produce the patterns you want (not tested though).
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
Mister Epic: Afaik Youtube simply drops frames until the framerate is <= 30, so your 30 and 60 uploads should be the same.
Warp wrote:
It would still be nice to see how the Super Metroid clip would look like with averaged frames.
Like this. Personally I don't think the blurring is worse than having non-smooth motion or no effect at all. Btw. don't use interlacing and weaving for this, it can lead to "line jumping" in some cases.
function BlendFields(clip)  {
	clip
	(FrameCount % 2 == 1)  ?  DuplicateFrame(FrameCount - 1)  :  nop
	Layer(SelectEven, SelectOdd, level=128) 
}
As for a function that "stretches" frames over time, that's what ConvertFPS does, and I think it creates clips where moving objects alternate between blurry and sharp, like bad frameblended 24 fps -> 30 fps video conversions.
creaothceann
He/Him
Editor, Experienced Forum User
Joined: 4/7/2005
Posts: 1874
Location: Germany
It's Super Metroid with new graphics, new maps and Samus controls/abilities hacked - all to make the game more like MZM.