Hello!
To be blunt and fast is there a way to insert a .png logo with a transparent layout in either the .ass file or Avisynth script?
Cheers
+ Reply to Thread
Results 1 to 18 of 18
-
-
use x and y coordinates to move them, or position them when you generate your logo (i.e. make the png the same size as your video frame dimension, and move the logo wherever you want in your image editor)
http://avisynth.org/mediawiki/Overlay
e.g.
Code:a1=AviSource("file.avi") a2=ImageSource("logo.png",pixel_type="RGB32") Overlay(a1,a2,mask=a2.ShowAlpha(),x=50,y=50)
To time it, cut it up into segments with trim(), so that you only apply the logo to sections that you want
e.g.
Code:a=AviSource("file.avi").Trim(0,100) b=AviSource("file.avi").Trim(101,200) c=AviSource("file.avi").Trim(201,300) b2=ImageSource("logo.png",pixel_type="RGB32"). b3=Overlay(b,b2,mask=b2.ShowAlpha(),x=50,y=50) a++b3++c
Last edited by poisondeathray; 19th Feb 2010 at 15:32.
-
Tnx! It worked perfectly! Now for one more question how do I make a fade in/out, not just pop in?
-
You would normally use fade() or fadeio() or one of it's variants
http://avisynth.org/mediawiki/Fade
But there seems to be a problem with fading out for the overlay. The workaround was to reverse the clip and use fadein. See this thread for more info:
https://forum.videohelp.com/threads/305020-AviSynth-JDL_ApplyRange()-FadeIn()-Compatibility-Issue
Maybe someone has an easier way, but it seems to work -
The reason fade out didn't work in the other thread was because the logo clip was longer than the clip it was overlayed onto - the fade out was beyond the end of the visible part!
So you need something like this, to make the lengths match:
Code:a1=AviSource("file.avi") a2=ImageSource("logo.png",pixel_type="RGB32", end=a1.frameCount) Overlay(a1,a2,mask=a2.ShowAlpha().FadeIO0(20),x=50,y=50)
-
Hum I actually pulled it off but the problem now is that the video & audio don't match exactly. Here's my code:
Code:LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TIVTC.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgdecode.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\telecidehints.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fieldhint.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrain.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\nnedi.dll") function Preset0(clip c) { #Name: Default c removegrain(mode=1) return last } a=DirectShowSource("C:\Users\shorto\Desktop\enkoding\commandline\uverworld.avi", fps=23.976).Trim(0,120) b=DirectShowSource("C:\Users\shorto\Desktop\enkoding\commandline\uverworld.avi", fps=23.976).Trim(121,167) c=DirectShowSource("C:\Users\shorto\Desktop\enkoding\commandline\uverworld.avi", fps=23.976).Trim(168,5647) d=DirectShowSource("C:\Users\shorto\Desktop\enkoding\commandline\uverworld.avi", fps=23.976).Trim(5648,5783) b2=ImageSource("logo.png",pixel_type="RGB32") b3=Overlay(b,b2,mask=b2.ShowAlpha().FadeIn(27),x=0,y=75) d4=Overlay(d,b2,mask=b2.ShowAlpha().FadeIn(27),x=0,y=75) a++b3++b3.reverse()++b++c++d++d4 Spline36Resize(720,544) TextSub("C:\Users\shorto\Desktop\enkoding\commandline\karanew.ass")
-
You've got section 'b' repeated 3 times (once in reverse) and section 'd' twice. Is this what you want?
The 'reverse' trick is unnecessary if you follow my post above.
Also, you should use AviSource instead of DirectShowSource, especially when trimming, since the latter is not always frame-accurate. -
I basicly need the logo to appear 2 times, one time with fade in and fade out the other time only fade in. That's why I inserted the b so many times.
-
You probably want something like:
Code:v=AviSource("C:\Users\shorto\Desktop\enkoding\commandline\uverworld.avi) a=v.Trim(0,120) b=v.Trim(121,167) c=v.Trim(168,5647) d=v.Trim(5648,5783) b2=ImageSource("logo.png",pixel_type="RGB32") b3=Overlay(b,b2,mask=b2.ShowAlpha().Trim(0,46).FadeIO0(27),x=0,y=75) d2=Overlay(d,b2,mask=b2.ShowAlpha().FadeIn(27),x=0,y=75) a++b3++c++d2
-
Script error: expected a, or)
What does that mean? xD It's stated for the line "b2=ImageSource("logo.png",pixel_type="RGB32") " -
Script error: expected a, or)
What does that mean? xD It's stated for the line "b2=ImageSource("logo.png",pixel_type="RGB32") "
It usually means you have an extra bracket, comma, or quotation mark. Post the full script (copy & paste) and error
Last edited by poisondeathray; 20th Feb 2010 at 08:20.
-
Here we go! xD
The script:
Code:LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TIVTC.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgdecode.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\telecidehints.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fieldhint.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrain.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\nnedi.dll") function Preset0(clip c) { #Name: Default c removegrain(mode=1) return last } v=AviSource("C:\Users\shorto\Desktop\enkoding\commandline\uverworld.avi) a=v.Trim(0,120) b=v.Trim(121,167) c=v.Trim(168,5647) d=v.Trim(5648,5783) b2=ImageSource("logo.png",pixel_type="RGB32") b3=Overlay(b,b2,mask=b2.ShowAlpha().Trim(0,46).FadeIO0(27),x=0,y=75) d2=Overlay(d,b2,mask=b2.ShowAlpha().FadeIn(27),x=0,y=75) a++b3++c++d2 Spline36Resize(720,544) TextSub("C:\Users\shorto\Desktop\enkoding\commandline\karanew.ass")
Code:AviSynth script error: Script error: expected a , or) (C:\Users\shorto\Desktop\enkoding\commandline\TEST ZA PVJE.avs, line 22, column 20)
-
I'm not seeing any errors. Are you sure that's the correct (current) script? Did you save it and re-open it ?
If you scroll up to post#4, I had a typo, I had a "." at the end of that line that shouldn't be there -
Similar Threads
-
avisynth - overlay fadein from transparent
By doma79 in forum EditingReplies: 12Last Post: 6th Dec 2011, 11:38 -
Aegisub effect
By xxxThiefxxx in forum Newbie / General discussionsReplies: 0Last Post: 8th Mar 2011, 14:35 -
aegisub
By simonrule in forum SubtitleReplies: 2Last Post: 9th Nov 2009, 04:05 -
Adding Transparent Logos onto VOB Files
By agtjones in forum EditingReplies: 27Last Post: 14th Dec 2008, 10:57 -
Aegisub newbie
By diablo_jones999 in forum SubtitleReplies: 0Last Post: 12th May 2008, 11:10