I had an idea which seemed interesting to Flygon & sgrunt.
It's about simplier timing for subtitles in AviSynth script.
a = AVISource("movie.avi")
b = ImageSource(file="logo.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
c = BlankClip(b, audio_rate=a.AudioRate, channels=a.AudioChannels)
d = AudioDub(b, c).Lanczos4Resize(c.width, c.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
#Specify 'subff' as the first frame for your subtitles. It is better to set the first frame of the first level here.
subff = 100
last = d + a
Subtitle("Super Example Bros. by Heavy Weapons Guy\nPlaying time: 4:48.07\nRerecord count: 9001", y=165, align=8, first_frame=subff, last_frame=subff+300, size=13.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
Subtitle("This is a tool-assisted recording.\nFor details, visit http://TASVideos.org/", y=180, align=8, first_frame=subff+301, last_frame=subff+601, size=15.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
ConvertToYV24(chromaresample="point", matrix="PC.601")
ConvertToYV12(chromaresample="lanczos4", matrix="PC.601")
If we Change FPS, timing must be fixed acourding to that:
a.FrameRate * 5 must be plused instead of defined 300 frames for 60 fps.
Arguable example:
a = AVISource("movie.avi").ChangeFPS(25)
b = ImageSource(file="logo.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
c = BlankClip(b, audio_rate=a.AudioRate, channels=a.AudioChannels)
d = AudioDub(b, c).Lanczos4Resize(c.width, c.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
#Specify 'subf1' as the first frame for your subtitles. If is better to set the first frame of the first level here.
subf1 = 100
subf2 = a.FrameRate * 5
last = d + a
Subtitle("Super Example Bros. by Heavy Weapons Guy\nPlaying time: 4:48.07\nRerecord count: 9001", y=165, align=8, first_frame=subf1, last_frame=subf1+subf2, size=13.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
Subtitle("This is a tool-assisted recording.\nFor details, visit http://TASVideos.org/", y=180, align=8, first_frame=subf1+subf2+1, last_frame=subf1+subf2+subf2+1, size=15.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
ConvertToYV24(chromaresample="point", matrix="PC.601")
ConvertToYV12(chromaresample="lanczos4", matrix="PC.601")
Example:
http://www.youtube.com/watch?v=BYCl09zEljw