Player (66)
Joined: 4/21/2011
Posts: 232
Primary, stream and youtube all have different target resolutions. Preemptively targeting one res compromises the others.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Assuming you have a PSXjin dump saved under the name "test", you get these files:
000_test.avi
001_test-640x480.avi
002_test-368x216.avi
003_test-320x224.avi
...
000_test.wav
This will load all of them... (unfortunately it can get very slow when the resolutions become very large):
Open_PSXjin("test")
# BilinearResize(1024, 768)    # final resolution
# FlipVertical                 # may be necessary with some codecs
last




function Open_PSXjin(string Name)  {
        Base  = "000_" + Name
        Video = DSS2(Base + ".avi")
        Video = PSXjin_FindSegmentFile(Video, 1, "_" + Name + "-")
        Audio = WAVSource(Base + ".wav")
        AudioDub(Video, Audio)
}


function PSXjin_FindSegmentFile(clip Video, int Index, string Name)  {
        s = String(Index, "%03.0f") + Name
        f = PSXjin_FindSegmentFileX(s, 256)
        return (f != "")  ?  Video.PSXjin_AddSegment(f).PSXjin_FindSegmentFile(Index + 1, Name)  :  Video
}


function PSXjin_FindSegmentFileX(string Base, int x)  {
        s = Base + String(x, "%03.0f") + "x"
        f = PSXjin_FindSegmentFileY(s, 216)
        return (f != "")  ?  f
        \:     (x < 640)  ?  PSXjin_FindSegmentFileX(Base, x + 16)
        \:     ""
}


function PSXjin_FindSegmentFileY(string Base, int y)  {
        s = Base + String(y, "%03.0f") + ".avi"
        return Exist(s)   ?  s
        \:     (y < 480)  ?  PSXjin_FindSegmentFileY(Base, y + 8)
        \:     ""
}


function PSXjin_AddSegment(clip Video, string FileName)  {
        v1 = Video
        v2 = DSS2(FileName)
        x  = LCM(v1.Width , v2.Width )
        y  = LCM(v1.Height, v2.Height)
        return v1.PointResize(x, y)
        \+     v2.PointResize(x, y)
}


################################ tools ################################


function LCM(int a, int b)  {
        # Least Common Multiple
        # en.wikipedia.org/wiki/Least_common_multiple#Computing_the_least_common_multiple
        Assert(a > 0, "LCM: a must be greater than zero")
        Assert(b > 0, "LCM: b must be greater than zero")
        return (a * b) / GCD(a, b)
}


function GCD(int u, int v)  {
        # Greatest Common Divisor
        # en.wikipedia.org/wiki/Binary_GCD_algorithm#Recursive_version_in_C
        Assert(u > 0, "GCD: u must be greater than zero")
        Assert(v > 0, "GCD: v must be greater than zero")
        return (u == v)           ?  u
        \:     (u == 0)           ?  v
        \:     (v == 0)           ?  u
        \:     even(u) && odd(v)  ?  GCD((u    ) / 2, v    )
        \:     even(u)            ?  GCD((u    ) / 2, v / 2) * 2
        \:     even(v)            ?  GCD((u    )    , v / 2)
        \:     (u > v)            ?  GCD((u - v) / 2, v    )
        \:                           GCD((v - u) / 2, u)
}


function even(int i)  {return ((i % 2) == 0)}
function odd (int i)  {return ((i % 2) == 1)}
Player (36)
Joined: 9/11/2004
Posts: 2631
My encoding script for linux (uses deldup and tasblend, doesn't not use avisynth.) https://github.com/OmnipotentEntity/encodingscripts/blob/master/assemble-mp4-deldup.sh
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Joined: 1/1/2013
Posts: 27
it looks like that youtube hd encodes can get really big in filesize which might be a problem because the youtube filesize limit is 20gig. i see a 320x240 psx movie i.e. is after encoding 2560x1920 but wouldn't it be enough to get 1440x1080 which would be max resolution on youtube? this should make the filesize smaller for longer movies like final fantasy or similar rpgs. now the question how might this be possible to realise with the tasencodingpackage? i do not really find the line in the encode.avs where it can be changed.
Emulator Coder, Skilled player (1129)
Joined: 5/1/2010
Posts: 1217
JohnnyG wrote:
it looks like that youtube hd encodes can get really big in filesize which might be a problem because the youtube filesize limit is 20gig.
Yes, they get big. And AFAIK, the limit is 64GB now.
JohnnyG wrote:
i see a 320x240 psx movie i.e. is after encoding 2560x1920 but wouldn't it be enough to get 1440x1080 which would be max resolution on youtube?
Actually, 2560x1920 is likely going to result smaller encode than 1440x1080 (due to how h.264 works). And youtube does support resolutions above 1080p (at least up to 4096x3072).
Joined: 1/1/2013
Posts: 27
thanks for your reply. i think i am just at the very beginning of encoding...
Spikestuff
They/Them
Editor, Publisher, Expert player (2666)
Joined: 10/12/2011
Posts: 6455
Location: The land down under.
Ilari wrote:
Actually, 2560x1920 is likely going to result smaller encode than 1440x1080 (due to how h.264 works). And youtube does support resolutions above 1080p (at least up to 4096x3072).
but doesn't support 2560x1200 (512x240 upscaled) GOOD JOB YOUTUBE! (goes back and tries to re-encode crash 2 (That will be 6 weeks from now))
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Emulator Coder, Skilled player (1129)
Joined: 5/1/2010
Posts: 1217
Spikestuff wrote:
but doesn't support 2560x1200 (512x240 upscaled) GOOD JOB YOUTUBE!
512x240 -> 2048x1920 ?
Spikestuff
They/Them
Editor, Publisher, Expert player (2666)
Joined: 10/12/2011
Posts: 6455
Location: The land down under.
Ilari wrote:
Spikestuff wrote:
but doesn't support 2560x1200 (512x240 upscaled) GOOD JOB YOUTUBE!
512x240 -> 2048x1920 ?
same thing happens I'm just calling the multiple of 5 not the multiple of 8
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
JohnnyG wrote:
It looks like Youtube HD encodes can get really big in file size, which might be a problem because the Youtube file size limit is 20gig.
You can always split the video into several YT parts. To be honest I don't see the need for higher resolutions than 720p (native resolution = 240p) or 1080p (native resolution = 480p; use PointResize 2x first). The most important thing is to avoid YT's 480p mode which degrades quality too much.
Player (66)
Joined: 4/21/2011
Posts: 232
creaothceann wrote:
To be honest I don't see the need for higher resolutions than 720p (native resolution = 240p) or 1080p (native resolution = 480p; use PointResize 2x first).
And that is why its important to test things, because sometimes intuition is horribly wrong.
Language: avisynth

m=8 avisource("M:\TAS\DONE\claymates\Claymates.avi") trim(13000,13999) ChangeFPS(30) pointresize(m*width,m*height) ConvertToYV24(chromaresample="point", matrix="Rec709") ConvertToYV12(chromaresample="point", matrix="Rec709")
Language: batch

x264_8 --qp 0 --keyint 600 --output o_8.mkv cm.avs
1 - 2827386 bytes 2 - 3683965 3 - 9590697 4 - 5305784 5 - 14752989 6 - 7823310 7 - 18514433 8 - 4453002 You should test your own samples as well. I'd be interested to see a sample where 8x8 upsize isn't the smallest. P.S. 16x16 is smaller than 12x12 12 - 9,074,364 bytes 16 - 5,722,830 bytes
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
That's indeed counter-intuitive... By the way, was the encoding time similarly related?
Player (66)
Joined: 4/21/2011
Posts: 232
Time is more what you'd expect. 1 - 320.31 fps 2 - 170.65 fps 3 - 75.21 fps 4 - 55.87 fps 5 - 31.26 fps 6 - 26.92 fps 7 - 17.24 fps 8 - 16.40 fps 12 - 7.39 fps 16 - 4.04 fps
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Then I guess I'd still use the smaller size:
Publisher
Joined: 4/23/2009
Posts: 1283
creaothceann wrote:
To be honest I don't see the need for higher resolutions than 720p (native resolution = 240p) or 1080p (native resolution = 480p; use PointResize 2x first). The most important thing is to avoid YT's 480p mode which degrades quality too much.
There is a need for certain systems that do support higher resolutions like N64.
Player (66)
Joined: 4/21/2011
Posts: 232
creaothceann wrote:
Then I guess I'd still use the smaller size:
Those numbers were for only 1000 frames. My upload speed with tvcman caps out ~250kbps. So multiply your upload times by about 200. I could see a case for x4, but x3 and x5 should never be considered. And whatever you were suggesting with "1080p (native resolution = 480p; use PointResize 2x first)" should probably also be avoided.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Aktan wrote:
There is a need for certain systems that do support higher resolutions like N64.
I meant that 480p can be upscaled to 960p and then expanded to 1080p with black bars.
nanogyth wrote:
creaothceann wrote:
Then I guess I'd still use the smaller size:
Those numbers were for only 1000 frames. My upload speed with tvcman caps out ~250kbps.
I see...
Joined: 1/1/2013
Posts: 27
is it possible to use the hybrid script for ds encodes as well? i tried this script http://tasvideos.org/forum/viewtopic.php?p=326815&highlight=#326888 and saved the avi then run the hybrid script. but the script makes the movie go to 9216x1536 and there are like 5 screens then. how can the hybrid script work for youtube encodes? edit please dont kill me, found it myself. this was probably one of the dumbest things in my life. D i did not know that the hybrid script deals the ds encodes by itself.
Site Admin, Skilled player (1256)
Joined: 4/17/2010
Posts: 11499
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Set nds = true manually, hd = true, and preview the script.
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.
Site Admin, Skilled player (1256)
Joined: 4/17/2010
Posts: 11499
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Can importing many avi segments of similar resolution be looped? For example, from movie001.avi to movie026.avi? I've seen some strange avisynth suggestions of recursion, but I have no idea how to set it up when we have digits before the real number for some files, and no digits there for 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.
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
Site Admin, Skilled player (1256)
Joined: 4/17/2010
Posts: 11499
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
How about this
Language: avisynth

function AppendSegment( \ string base, \ int first_val, \ int last_val, \ string format \){ AviSegment = base + String(first_val, format) + ".avi" result = Eval("AviSource(AviSegment)") return (first_val < last_val) \ ? result + AppendSegment(base,first_val+1,last_val,format) \ : result } /* * Example: AppendSegment("movie", 1, 30, "%02.0f") * goes from "movie01.avi" to "movie30.avi", * returns concatenated AviSources per segment. * For string format usage, see: * http://avisynth.org/mediawiki/Internal_functions/Conversion_functions */
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.
Post subject: Update Link
Joined: 12/19/2007
Posts: 40
I think you need to update the link to this on HybridEncodeScript.html. I had to use Google to find the proper link. The following appears to be correct: http://code.google.com/p/feos-tas/source/browse/trunk/Misc/TASEncodingPackage.7z
Site Admin, Skilled player (1256)
Joined: 4/17/2010
Posts: 11499
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Updated it, thanks.
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.
Post subject: Question regarding the Hybrid Encode AVISynth Script
admiralpete
He/Him
Joined: 11/22/2013
Posts: 14
Location: Southwestern PA
I've been playing with your Hybrid Script for a bit, and I was curious how to get ng_deblink to calculate shaking information better. I'm testing an encode of Mega Man X I made, and every time an enemy or a boss makes the screen shake, the shake doesn't work properly. The end result I would like is shake effects like the ones produced by TASBlend. If anyone could help, I would appreciate it. I've tried changing the settings for the boolean options (Test, Sharp, Stabilize, etc), but none of them gave me the shaking accuracy that I am trying to achieve.