View Full Version : adding a logo with JDL_ImageSource and Overlay
magnatique
9th March 2005, 01:01
I need to load up a logo on top of a video... I also need to use the audiodub setting to have audio playing on the avs file since I cannot load it externally in virtualdub ... for a batch process.
I found out some posts from stickboy on how to do this, but I am kind of in an impass... the source is dvd, did a d2v file with dvd decrypter as well as the wav from there... I intend on opening this up in virtual dub for xvid compression
here it is :
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\dgdecode.dll")
#c = BlankClip(color=$009900, pixel_type="yuy2", length=300, fps=29.97)
c = mpeg2source("ffra17.d2v")
audio=WAVsource("ffra17.wav")
AudioDub(c,audio)
# Load the logo and its mask. Note that JDL_ImageSource expects full,
# absolute paths to the image files. JDL_ImageSource is part of
# jdl-util.avsi from <http://www.avisynth.org/stickboy/>
logo = JDL_ImageSource("eagle.jpg", fps=c.FrameRate())
logoMask = JDL_ImageSource("eagle-mask.png", fps=c.FrameRate())
# Display the logo for 150 frames (~5 seconds for NTSC video), and have it
# fade in and out over 10 frames at each end.
logoMask = logoMask.Loop(150).FadeIO(10)
# Display the logo in the bottom right corner with a 10 pixel margin.
Overlay(newc, logo,
\ x=(c.Width() - logo.Width() - 10),
\ y=(c.Height() - logo.Height() - 10),
\ mask=logoMask, opacity=1.0)
# For demonstrative purposes, display the original logo and the mask
# to get a better idea what's going on.
Overlay(logo, x=0, y=0)
Overlay(logoMask, x=0, y=logo.Height())
it will just not run it... if I take the audiodub part out, it will show the logo.
is there anything else I should really add in this script to frameserve to virtualdub that I am missing which can really increase quality or anything else of the sort?
THANKS!
Also, this will show the logo for 150 frames... if I'd want it for the full length of the clip, is there an easier way than to specify the number of clips?
Thanks!
stickboy
9th March 2005, 08:07
Originally posted by magnatique
it will just not run it... if I take the audiodub part out, it will show the logo.What happens when you try? What is the error message you get?
Even if you take the AudioDub line out, I don't see how you can load the script successfully.LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\dgdecode.dll")
#c = BlankClip(color=$009900, pixel_type="yuy2", length=300, fps=29.97)
c = mpeg2source("ffra17.d2v")
audio=WAVsource("ffra17.wav")
AudioDub(c,audio)
# Load the logo and its mask. Note that JDL_ImageSource expects full,
# absolute paths to the image files. JDL_ImageSource is part of
# jdl-util.avsi from <http://www.avisynth.org/stickboy/>
logo = JDL_ImageSource("eagle.jpg", fps=c.FrameRate())
logoMask = JDL_ImageSource("eagle-mask.png", fps=c.FrameRate())
# Display the logo for 150 frames (~5 seconds for NTSC video), and have it
# fade in and out over 10 frames at each end.
logoMask = logoMask.Loop(150).FadeIO(10)
# Display the logo in the bottom right corner with a 10 pixel margin.
Overlay(newc, logo,
\ x=(c.Width() - logo.Width() - 10),
\ y=(c.Height() - logo.Height() - 10),
\ mask=logoMask, opacity=1.0)
newc isn't defined anywhere. Was your AudioDub line meant to be:
newc = AudioDub(c, audio)?
Also, this will show the logo for 150 frames... if I'd want it for the full length of the clip, is there an easier way than to specify the number of clips?Number of clips? Did you mean number of frames? Change the logoMask line:
logoMask = logoMask.Loop(c.FrameCount())or, if you want the logo to fade in and out:
logoMask = logoMask.Loop(c.FrameCount() - 2).FadeIO(10)
magnatique
9th March 2005, 15:36
Originally posted by stickboy
What happens when you try? What is the error message you get?
Even if you take the AudioDub line out, I don't see how you can load the script successfully.newc isn't defined anywhere. Was your AudioDub line meant to be:
newc = AudioDub(c, audio)?
Number of clips? Did you mean number of frames? Change the logoMask line:
logoMask = logoMask.Loop(c.FrameCount())or, if you want the logo to fade in and out:
logoMask = logoMask.Loop(c.FrameCount() - 2).FadeIO(10)
that was it for the frames, that is what I meant :)
as for the script, my bad on the newc.. should be c , that was from some tests I had made that I edited out when I posted here...
what happens is it runs but doesn't show the overlay... my guess was that it does the overlay, but the audiodub takes the original video scene...
I'll post the real version of my script on the next msg..
magnatique
9th March 2005, 16:43
I guess it was a newb's error lol
what wouldn't work now is working... I think it was the full path's being needed or something of the sort heh...
anyhow, here's what I have came up with
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\dgdecode.dll")
#c = BlankClip(color=$009900, pixel_type="yuy2", length=300, fps=29.97)
c = mpeg2source("e:\ffra17\ffra17.d2v")
audio=WAVsource("e:\ffra17\ffra17.wav")
z= AudioDub(c,audio)
# Load the logo and its mask. Note that JDL_ImageSource expects full,
# absolute paths to the image files. JDL_ImageSource is part of
# jdl-util.avsi from <http://www.avisynth.org/stickboy/>
logo = JDL_ImageSource("e:\ffra17\eagle.jpg", fps=z.FrameRate())
logoMask = JDL_ImageSource("e:\ffra17\eagle-mask.png", fps=z.FrameRate())
# Display the logo for 150 frames (~5 seconds for NTSC video), and have it
# fade in and out over 10 frames at each end.
logoMask = logoMask.Loop(z.FrameCount() - 2)
# Display the logo in the bottom right corner with a 10 pixel margin.
Overlay(z, logo,
\ x=(z.Width() - logo.Width() - 10),
\ y=(z.Height() - logo.Height() - 10),
\ mask=logoMask, opacity=1.0)
btw, where is the best place to apply a brightness/contrast to the movie? from avisynth or virtualdub?
magnatique
12th March 2005, 00:20
stickboy,
is there any way I can have that logo come up for say 10 seconds at specified frame counts?
like each 30000 frames, I'd have the logo come up and down?
stickboy
12th March 2005, 09:02
There may be better ways to do it, but one idea is to use my LengthenClip function (part of my ApplyEvery plug-in (http://www.avisynth.org/stickboy/)). (Untested code follows):
# Create a mask that shows the logo for 10 seconds and that fades
# in during the first ~10 frames and fades out during the last
# ~10 frames
logoMask = logoMask.Loop(Round(c.FrameRate() * 10)).FadeIO(10)
# Don't do anything for ~30000 frames
logoMask = logoMask.LengthenClip(30000)
# Loop the mask (nearly) infinitely
logoMask = logoMask.Loop()
# Call Overlay as before to use the mask.
Overlay(..., mask=logoMask, ...)
magnatique
22nd March 2005, 22:00
Thanks StickBoy, it works fine :)
the only problem I am experiencing is this :
It fades in perfectly, shows the clip for the specified amount of time, then fades out... but when it fades out, and then everytime it fades in/out after that, it looks like the mask is not on the same location as before, I believe it comes out inverted... any way around that?
stickboy
23rd March 2005, 03:05
Originally posted by magnatique
It fades in perfectly, shows the clip for the specified amount of time, then fades out... but when it fades out, and then everytime it fades in/out after that, it looks like the mask is not on the same location as before, I believe it comes out inverted... any way around that?By inverted you mean it's upside-down?
It's probably that stupid bug with ImageReader in 2.55. Maybe try AviSynth 2.54?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.