So, hey, guys, I managed to kick the ass of the official website encoding scripts with one script. Two birds with one stone. And extra functionality.
Thank Mister Epic, Aktan, Grunt, and I.
See below.
#The SD and HD encoding script
#Created by Flygon
#Many great contributions come from Mister Epic and especially Grunt
#Super thanks to Aktan for the audio/video desync fixing algorithm!
#Thank you for using this script!
#This is the AVI movie source, change the filename if your source movie uses a different filename
a = AVISource("movie.avi").ConvertToRGB24()
#The below filenames are the filenames of your logo, set one for handheld consoles and TV based consoles, be sure to keep the "" tags
handheldlogo = "handheld.png"
consolelogo = "console.png"
#This sets the start time for the subtitles to start displaying, this is set as a frame number
subff = 1997
#This is the delay for the second set of subtitles to come in
#This is useful if it is more asthetically pleasing to delay the second set of subtitles
#Do not set this lower than 1, otherwise the subtitles will overlap and look ugly
subdelay = 1
#Adjust the below items to adjust the subtitles, this is so that the movie will have the correct subtitles
#All the required information will be on the movies submission page
#Set istherebranch to true if the movie has an additional branch, otherwise, set it to false
#Be sure to keep the "" tags except for the isthereabranch flag
gametitle = "Super Example Bros."
isthereabranch = false
branchname = "Pyro Edition"
author = "Girlpyro"
time = "13:37.34"
rerecords = "80085"
#Below is the values for the left, center, or right positioning for the subtitles, DO NOT adjust unless you know what you're doing
#This is required for the next segment of this script to function
positionleft = 7
positioncenter = 8
positionright = 9
#This sets the position of the subtitles in terms of direction, it can be left, right, or center
#Set positionleft for left, set positioncenter for center, set positionright for right
#Setting this to positioncenter is considered standard practice, other positions shouldn't be used unless it looks far better
position = positioncenter
#This sets the y position for the subtitles, basically, how high or low they are up on the screen
#The higher the number, the lower the subtitles
ypos = 8
#Set this to false for SD encodes, set this to true for HD encodes
isthishd = false
#This setting adjust the framerate for HD encodes when uploading to YouTube, this is to save space due to YouTube having a maximum framerate of 30 anyway
#It is suggested to be at either 24 fps or 30fps for NTSC games (Depending on if they use alternating frame flicker or not)
#PAL games should generally be set to 30 fps, it can be set to 25 fps if there is no flickering, but it's difficult to notice the strobing effect in 30fps anyway
hdframerate = 24
#Set this to true if this is a handheld console to disable aspect correction
#This setting has no affect on the aspect of SD encodes, but is still needed to change the logo
handheld = false
#This setting turns the audio/video desync fixer on and off according to true and false
#The below should always be set to true, barring the unusual occasion that it actually desyncs the audio
#This should only be needed for PCEngine dumps, but may be useful for other consoles
desyncfixer = true
#THE BELOW CODE SHOULDN'T BE MODIFIED UNLESS YOU KNOW EXPLICITLY WHAT YOU ARE DOING !!!
#This automatically fixes length based audio/video desync if it exists inside the encode (eg. Many PCEngine games)
desyncfixer ? Eval("""
fixedaudioratefloat = (a.AudioLengthF * a.FrameRateNumerator) / (a.FrameCount * a.FrameRateDenominator)
fixedaudiorate = Floor(fixedaudioratefloat)
a.AssumeSampleRate(fixedaudiorate)
""") : Eval("""
""")
#High Definition
isthishd ? Eval("""
factor = (a.height > 540) ? 1 : \
(a.height > 270) ? 2 : \
(a.height > 180) ? 3 : 4
b = a.PointResize(a.width * factor, a.height * factor)
c = handheld ? b : ((b.width < b.height * 4 / 3) ? b.PointResize(b.height * 4 / 3, b.height) : b.PointResize(b.width, b.width * 3 / 4))
g = c.PointResize(c.width * 2, c.height * 2)
multi = (factor * 2)
#Standard Definition
""") : Eval("""
g = a.PointResize(a.width * 1, a.height * 1)
multi = 1
""")
#Logo stuffs
handheld ? Eval("""
d = ImageSource(file=handheldlogo, start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
""") : Eval("""
d = ImageSource(file=consolelogo, start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
""")
e = BlankClip(d, audio_rate=a.AudioRate, channels=a.AudioChannels)
f = AudioDub(d, e).Lanczos4Resize(g.width, g.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
last = f + g
#This is the first set of subtitles, this shouldn't be modified unless you know what you are doing
isthereabranch ? Eval("""
Subtitle(gametitle + "\n" + branchname + "\nPlayed by " + author + "\nPlaying time: " + time + "\nRerecord count: " + rerecords, y=(ypos * multi), align=position, first_frame=subff, last_frame=(subff + 300), size=(10.0 * multi), text_color=$15FFFFFF, halo_color=$00000000, lsp=1)
""") : Eval("""
Subtitle(gametitle + "\nPlayed by " + author + "\nPlaying time: " + time + "\nRerecord count: " + rerecords, y=(ypos * multi), align=position, first_frame=subff, last_frame=(subff + 300), size=(10.0 * multi), text_color=$15FFFFFF, halo_color=$00000000, lsp=1)
""")
#The below line is for calculating the frame number for the second subtitles to begin
lastframenum=(subff + 300)
#This is the second set of subtitles, do not modify unless absolutely necessary
Subtitle("This is a tool\nassisted recording.\nFor details, visit\nhttp://TASVideos.org/", y=(ypos * multi), align=8, first_frame=(lastframenum + subdelay), last_frame=(lastframenum + subdelay + 300), size=(10.0 * multi), text_color=$15FFFFFF, halo_color=$00000000, lsp=1)
#This activates the frame dropper for HD encodes
#This depends on if the game simulates transperancy with alternating frame flicker
#The frame dropper saves filesize without image loss, because YouTube caps at 30fps
isthishd ? Eval("""
ChangeFPS(hdframerate)
""") : Eval("""
""")
#SD encodes need a resizing filter for the colourspace reduction
#HD encodes need to be point resized to keep the colour information faithful
ConvertToYV24(matrix="PC.601", chromaresample="point")
isthishd ? Eval("""
ConvertToYV12(matrix="PC.601", chromaresample="point")
""") : Eval("""
ConvertToYV12(matrix="PC.601", chromaresample="lanczos4")
""")
return last
Basically... this is the most advanced and most usable AviSynth script usable for standard TASVideos encoding.
----
Old post below
Exactly what it says on the tin. Set isthishd to true or false, depending on if you want HD. The subtitles are automatically adjusted, but you still need to change the y position and alignments, obviously.
*code*
We could use some people willing to test this script.
I send
massive greets to Grunt and Aktan! Without them, this script would be impossible for me to make!