GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
You've probably seen Omni's HQx encode for Sonic 3 & Knuckles, then you've probably seen my HQx encodes for some other games. I'm sharing an easy, AviSynth, way to encode using HQx filters. First, you have to get the PointSize plugin for AviSynth. Thanks to sgrunt for finding this plugin. Then, once you have installed that plugin, you can now use HQ2x, HQ3x and HQ4x in AviSynth! But how? Here is a sample script using HQ4x.
movie = AVISource("movie.avi").ConvertToRGB32() 
resizedmovie = hq4x(movie) 
logo = ImageSource(file="logohd.png", start=0, end=119, fps=resizedmovie.FrameRate).ConvertToRGB32()
logoaudio = BlankClip(logo, audio_rate=44100, channels=2) 
muxedlogo = AudioDub(logo, logoaudio).Lanczos4Resize(resizedmovie.width, resizedmovie.height).AssumeFPS(movie.FrameRateNumerator, movie.FrameRateDenominator) 
final = muxedlogo + resizedmovie 
final.ConvertToYV24(chromaresample="point") 
final.ConvertToYV12(chromaresample="lanczos4") 
return final
It's basically the same script HD encoders generally use, but PointResize is replaced by HQx, since that filter automatically resizes the source dump. And for YV12, lanczos4 is used instead of point. Thanks to Aktan for that suggestion. But that's not all. You probably want to make the video 6x or 8x bigger than the original source, right? For that kind of thing, you can combine multiple HQx commands like this.
hq2x(hq4x(movie))
Like this, you make 2x bigger a video that was made 4x bigger. As a result, the video is 8x bigger. When doing such a thing, for the best result, make sure to put the biggest HQx inside the smallest HQx. For example, to make a video 6x bigger, you should do it like this.
hq2x(hq3x(movie))
And not like this.
hq3x(hq2x(movie))
That's it for the easy, AviSynth way to encode using HQx filters. I've taken the same frame of a movie twice, one is resized using point resizing while the other is resized using HQx filters. Point HQx Of course, it's possible to get more noticeable results using a less colorful game. If you want to see HQx in motion, you can click here. So, that's pretty much about it.
Publisher
Joined: 4/23/2009
Posts: 1283
It must be noted, that blurring just for YouTube to keep all frames makes the video a blurry mess. It's a bad idea to do IMO. I rather drop frames and see the movie sharper.
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Aktan wrote:
It might be noted, that blurring just for YouTube makes the video not sharp and a blurry mess. It's a bad idea to do IMO.
That's the second complaint I get about that. The first one was made by private messaging from a fellow TASVideo member called hegyak during a HD encoding request.
hegyak wrote:
I don't mind what method you do it in, but please do not use Frame Blending.
I'll stop using this now. Anyway, what do you think of my HQx encoding guide?
Publisher
Joined: 4/23/2009
Posts: 1283
It's simple enough, but explain why hq2x(hq3x(movie)) instead of hq3x(hq2x(movie)). You said better result, but in what way?
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Aktan wrote:
It must be noted, that blurring just for YouTube to keep all frames makes the video a blurry mess. It's a bad idea to do IMO. I rather drop frames and see the movie sharper.
For some games it's useful - for example Metroid's and Super Metroid's elevator sequences. Mister Epic: "file" should be "path" and "b" is not defined (line 3). Are you using a newer AviSynth than 2.5.8?
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
For some games it's useful - for example Metroid's and Super Metroid's elevator sequences.
IMO somewhat a bad example cause those areas have no action, and skipping frames during those parts is not like you missed something. It's just Samus moving up and down! On the flip side, if all frames were blurred, then regular left right scrolling including background would probably be blurry. That, IMO, is not good.
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
creaothceann wrote:
Aktan wrote:
It must be noted, that blurring just for YouTube to keep all frames makes the video a blurry mess. It's a bad idea to do IMO. I rather drop frames and see the movie sharper.
For some games it's useful - for example Metroid's and Super Metroid's elevator sequences. Mister Epic: "file" should be "path" and "b" is not defined (line 3). Are you using a newer AviSynth than 2.5.8?
I don't know how to see the precise version, but I'm definately using 2.5. And thanks for pointing the mistake about b. I will correct that.
Aktan wrote:
It's simple enough, but explain why hq2x(hq3x(movie)) instead of hq3x(hq2x(movie)). You said better result, but in what way?
I don't know how to explain that, but I can definately see that putting the biggest inside the smallest is better than putting the smallest in the biggest. I've made a comparison picture right below. The top picture is made using hq2x(hq3x(movie)), while the bottom one is done using hq3x(hq2x(movie)). The top one looks better, right?
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
Mister Epic: "file" should be "path" and "b" is not defined (line 3). Are you using a newer AviSynth than 2.5.8?
To use the different chroma resamplers when changing colorspaces, you do need the newer AviSynth 2.6 (Alpha)
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Aktan wrote:
creaothceann wrote:
Mister Epic: "file" should be "path" and "b" is not defined (line 3). Are you using a newer AviSynth than 2.5.8?
To use the different chroma resamplers when changing colorspaces, you do need the newer AviSynth 2.6 (Alpha)
You're right, I have 2.6 Alpha. And I'm going to change the comparison up there.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Aktan wrote:
creaothceann wrote:
For some games it's useful - for example Metroid's and Super Metroid's elevator sequences.
IMO somewhat a bad example cause those areas have no action, and skipping frames during those parts is not like you missed something. It's just Samus moving up and down!
You'd miss Samus. Compare these two videos: Zoizite's "NES Metroid in 09:26" Lord Tom's "NES Metroid" in 08:19.32 In the first one, Samus vanishes (or doesn't) when she's hit or uses elevators. There's also a trick at 06:58 that the viewer can't see.
Mister Epic wrote:
I have 2.6 Alpha.
I tried using the Alpha, but there was only an incomplete release at sourceforge. :/
Mister Epic wrote:
The top picture is made using hq2x(hq3x(movie)), while the bottom one is done using hq3x(hq2x(movie)).
Well, the yellow/orange gradient is smoother in the bottom one. EDIT: Comparison between lq2x and hq2x: [URL=http://img524.imageshack.us/img524/8114/highquality.png][/URL] Top right and bottom left is lq2x; bottom right is hq2x; top left is differences.
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
You'd miss Samus. Compare these two videos:
Oh yea, it's the same problem as Mega Man when there are too many sprites on the screen. It's true in those parts, but still, to me, having everything blurry all the time and somewhat see those missing frames, is worse than dropping frames and missing some important frames.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Incidentally, about games that use frame blending, I intend to find a method of only doing it for specific segments of a TAS (Which should either minimize the problem... or make it even more obvious). Though, the method I have planned out so far is highly manual and won't work well for longer TAS's (Unless you really have the spare time).
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Flygon wrote:
Incidentally, about games that use frame blending, I intend to find a method of only doing it for specific segments of a TAS (Which should either minimize the problem... or make it even more obvious). Though, the method I have planned out so far is highly manual and won't work well for longer TAS's (Unless you really have the spare time).
I think it's a pretty bad idea. I think it will give a video that is sharp, and then suddenly blurry, and then suddenly sharp.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Flygon wrote:
Incidentally, about games that use frame blending, I intend to find a method of only doing it for specific segments of a TAS (Which should either minimize the problem... or make it even more obvious). Though, the method I have planned out so far is highly manual and won't work well for longer TAS's (Unless you really have the spare time).
If you want to do that, the code could look like this:
AVISource("00a.avi", "00b.avi", "00c.avi")
ConvertToRGB32
GaussResize(640, 480, p=66)
ConvertToYV12(chromaresample="lanczos4")

#m1(   0, 4000) +\
#m2(4001, 4100) +\
#m1(4101, 8000) +\
#m2(8001, 8100) +\
#m1(8101,    0)




function m1(clip c, int i1, int i2)  {c.Trim(i1, i2).ChangeFPS(c.FrameRate / 2)}    # method 1
function m2(clip c, int i1, int i2)  {c.Trim(i1, i2).BlendFields               }    # method 2


function BlendFields(clip c)  {
        c
        Overlay(SelectEven, SelectOdd, opacity=0.5)
}
Go through the video and add lines with m1/m2 until you have all spots covered, then uncomment the lines. Btw. BlendFields uses Overlay which internally works in YV colorspace, so to avoid conversions call it after converting to YV12. The clip given to BlendFields should have an even number of frames; I don't know if it'd work correctly otherwise.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11473
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
there is no function named "hq3x"
O_O wtf plugin put into correct directory...
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.
Joined: 6/4/2009
Posts: 570
Location: 33°07'41"S, 160°42'04"W
Aktan wrote:
I rather drop frames and see the movie sharper.
For what it's worth, I have to agree. Those blended youtube videos are incredibly annoying to me. Everything is so confusing, I prefer to lose some action and get sharper images.
honorableJay
He/Him
Joined: 8/18/2008
Posts: 104
Location: Albany, NY
It would be even better if youtube just started supporting 60fps movies.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11473
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
i'm afraid, only TASers need this, cuz they abuse Frame Advance for entertainment & 60fps support is needed to see the result. most of YT'ers don't need 60fps support
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.
Patashu
He/Him
Joined: 10/2/2005
Posts: 4042
What about games where damaged things flash at 30Hz?
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Publisher
Joined: 4/23/2009
Posts: 1283
Patashu wrote:
What about games where damaged things flash at 30Hz?
This problem was already mentioned. Blurring is probably better but depending on the framerate YouTube switches to (yes it's VFR), dropping frames may still work.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
If you want to convert flashing 60 fps to flashing 30 fps, you'd have to drop frames like this:
60 fps:     10101010          // 1 = visible, 0 = invisible
            12345678          // frame index

30 fps:     1010
            1256              // dropped every 3rd and 4th frame
With AviSynth that can be done with SelectEvery(4, 0, 1). The disadvantage is that it looks choppy, and doesn't simulate transparencies.
Joined: 11/29/2010
Posts: 8
Hello everybody, I tried using the plugin pointsize but I can not work. Could someone post an AVS settings completing the following example:
AVISource ("C: \ ssf2t.avi", audio = true) ConvertToRGB32 () loadplugin ("C: \ Program Files (x86) \ AviSynth 2.5 \ plugins \ pointsize.dll)
Tks for all
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
If you want to convert flashing 60 fps to flashing 30 fps, you'd have to drop frames like this:
60 fps:     10101010          // 1 = visible, 0 = invisible
            12345678          // frame index

30 fps:     1010
            1256              // dropped every 3rd and 4th frame
With AviSynth that can be done with SelectEvery(4, 0, 1). The disadvantage is that it looks choppy, and doesn't simulate transparencies.
Or, you could use ChangeFPS() and let it auto do that =p Edit: On second red, I now get what you mean. Oops! Yea, it's a viable solution, I guess.
Publisher
Joined: 4/23/2009
Posts: 1283
Cauptain wrote:
Hello everybody, I tried using the plugin pointsize but I can not work. Could someone post an AVS settings completing the following example:
AVISource ("C: \ ssf2t.avi", audio = true) ConvertToRGB32 () loadplugin ("C: \ Program Files (x86) \ AviSynth 2.5 \ plugins \ pointsize.dll)
Tks for all
I'm not sure of what you are asking. Could you rephrase the question?
Joined: 11/29/2010
Posts: 8
Aktan wrote:
I'm not sure of what you are asking. Could you rephrase the question?
I like to see a complete .AVS using pointsize plugin.