View Full Version : Script watermark animated
cadet51
20th January 2016, 20:01
Hello,
I am looking for a script that allows me to display an animated image (either gif, png, etc.) to capture or encoded via avisynth.
I happened to insert a watermark in this forum grace can be so thanks to you I will.
Sincerely younger
raffriff42
22nd January 2016, 03:01
There's ImageSourceAnim (http://avisynth.nl/index.php/ImageSource#ImageSourceAnim), but it does not work as far as I can tell.
If anyone has got an animated GIF to load with this or any other Avisynth filter, please tell me how you did it.
I would load the GIF in VirtualDub and save it as AVI. Save in RGB mode as "uncompressed" or using a lossless codec such as Huffyuv, Lagarith, UTVideo or MagicYUV.
(If GIF is odd-sized, crop it to a width & height divisible by 2 before saving to AVI)
You can even do transparency, IF there is one color that you can say is transparent. You may have to edit the GIF to make the "transparent" palette index color show a unique color after it's been converted to RGB32.
## background (your source here)
V=ColorBars.AmplifyDB(-12)
#return V.Info ## RGB32
## animation source:
A=AviSource("bravo-2.avi").Loop
## create transparency mask:
transparent_color=$00FFFF ## cyan
M=A.ResetMask
\ .ColorKeyMask(transparent_color, 1, 1, 1)
\ .ShowAlpha
#return M
## set animation speed:
A=A.AssumeFPS(5).ConvertFPS(V)
## overlay animation over background, lower right corner:
x=V.Width-A.Width-16
y=V.Height-A.Height-16
Layer(V, A.Mask(M), level=257, x=x, y=y)
Reel.Deel
22nd January 2016, 03:13
There's ImageSourceAnim (http://avisynth.nl/index.php/ImageSource#ImageSourceAnim), but it does not work as far as I can tell.
If anyone has got an animated GIF to load with this or any other Avisynth filter, please tell me how you did it.
To load GIFs I use FFImageSource from FFMS2 (FFVideoSource also works). LSMASHSource's LWLibavVideoSource is also able to do it, just tried with this:
https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif
Edit: ImageSourceAnim works on the file above :confused:.
StainlessS
22nd January 2016, 03:26
Earth would not work for me either with ImageSourceAnim, nor would this animated gif:- http://forum.doom9.org/showthread.php?p=1754166#post1754166
LWLibavVideoSource worked OK with both.
EDIT:
ImageSourceAnim works on the file above :confused:.
What was your script, dont work for me.
EDIT: Did you download the Devil Lib from somewhere ? (think there is a newer one)
Reel.Deel
22nd January 2016, 03:34
ImageSourceAnim works on the bravo.gif, I'm using AviSynth+ r1576, maybe that's why.
raffriff42
22nd January 2016, 03:44
LWLibavVideoSource FTW! Thank you!
http://avisynth.nl/index.php/LSMASHSource LoadPlugin(P + "LSMASH_Source\rev785\AviSynth\LSMASHSource.dll")
LWLibavVideoSource("bravo-1.gif").Loop
You still have to hack the GIF to get transparency...
StainlessS
22nd January 2016, 03:44
ImageSourceAnim works on the bravo.gif, I'm using AviSynth+ r1576, maybe that's why.
Could well be. :(
Reel.Deel
22nd January 2016, 03:57
You still have to hack the GIF to get transparency...
What do you mean? LWLibavVideoSource("bravo-1.gif").ShowAlpha() works just fine.
raffriff42
22nd January 2016, 04:50
I mean, I never tried that! Thanks, Reel.Deal.
cadet51
22nd January 2016, 17:25
Hello,
Thank you already for your help. I arrived launched the script but I can't have the miniaturized the picture on the screen.
I would then bring up the image for a while at the beginning of the film.
StainlessS
22nd January 2016, 19:32
Sorry cadet51, your English is not too good and probably nobody is quite sure what you are saying.
This is what I think you say:-
I arrived launched the script but I can't have the miniaturized the picture on the screen.
I launched the script but cannot get the gif to display.
I would then bring up the image for a while at the beginning of the film.
I would like to display the gif at the beginning of a movie.
############################
You need to post an example of the script that you tried, and also would be good if you can post
your gif on eg SendSpace.com or MediaFire.com so people can see what is wrong.
I know that this is an "English Only Forum", but I think it would be not out of order for you to provide
Additional text in your own language (but you must first provide the English).
.
StainlessS
22nd January 2016, 21:43
Am unlikely to be of any further assistance, I keep getting DEP (Data Execution Prevention, XP32) error message relating to
Windows Explorer. Only recently did system reinstall, nothing much more than Video related (and compilers) installed.
Going to re-install system again now.
Bye for now.
raffriff42
23rd January 2016, 04:36
You need to post an example of the script that you tried, and also would be good if you can post
your gif on eg SendSpace.com or MediaFire.com so people can see what is wrong.Agreed. If you do this, I will help you with the problem as you have stated it (but, sorry, without any new conditions or requests)
EDIT Hope the system comes together StainlessS.
cadet51
28th January 2016, 15:59
Hello,
Sorry for my English not good but I'm French. The script works well but rendering my logo does not fit all.
Example:
Logo avi
http://t1.someimage.com/oYEWvKV.jpg (http://someimage.com/oYEWvKV)
Logo with ShowAlpha
http://t1.someimage.com/1sITCys.jpg (http://someimage.com/1sITCys)
Video=DirectShowSource("D:\00042.m2ts",Audio=false,Fps=23.976)
Video=Assumefps(video,23.976)
logo=LSMASHVideoSource("D:\furax.mp4")
logoT=LSMASHVideoSource("D:\furax.mp4",format="RGB32").ShowAlpha(pixel_type="RGB32")
P1 = trim(Video,0,90)
P12 = trim(Video,91,335)
P2 = trim(Video,334,0)
OL1 = Overlay(P12, logo ,x=(P12.Width() - logo.Width() - 20), y=(P12.Height() - logo.Height() - 960), mask=logoT)
Video2=P1 + OL1 + P2
video2 =lanczosresize(video2,1920,1080)
ConvertToYV12(Video2)
Log without ShowAlpha
http://t1.someimage.com/B8ITnSV.jpg (http://someimage.com/B8ITnSV)
Video=DirectShowSource("D:\00042.m2ts",Audio=false,Fps=23.976)
Video=Assumefps(video,23.976)
logo=LSMASHVideoSource("D:\furax.mp4")
logoT=LSMASHVideoSource("D:\furax.mp4",format="RGB32")
P1 = trim(Video,0,90)
P12 = trim(Video,91,335)
P2 = trim(Video,334,0)
OL1 = Overlay(P12, logo ,x=(P12.Width() - logo.Width() - 20), y=(P12.Height() - logo.Height() - 960), mask=logoT)
Video2=P1 + OL1 + P2
video2 =lanczosresize(video2,1920,1080)
ConvertToYV12(Video2)
As you see, the red becomes clear that I want the black background.
Thanks for your help.
raffriff42
28th January 2016, 22:26
Your Logo source does not have a true Alpha channel. An alpha channel should look something like this:
https://www.dropbox.com/s/vgjdz1iksffyyyi/Script%20watermark%20animated%20M5.png?raw=1
(which I created in a paint editor from your image by converting to grayscale and manipulating video levels)
Assembling your image, with my Alpha mask, gives this result:
https://www.dropbox.com/s/q5aeqjv7osvk8zg/Script%20watermark%20Sintel%20M5-1.jpg?raw=1 (http://durian.blender.org/sharing/)
https://www.dropbox.com/s/1kg5di5piawk0pn/Script%20watermark%20Sintel%20M5-2.jpg?raw=1 (http://durian.blender.org/sharing/)
EDIT working script example:Video=DirectShowSource("D:\00042.m2ts",Audio=false,Fps=23.976)
Video=video.Assumefps(23.976)
logo=DirectShowSource("E:\furax-Fade2.mp4")
logoT= logo.ConvertToY8.Levels(21, 1.2, 64, 0, 255, coring=false) ## FAKE MASK FROM LUMA
P12 = Video.trim(91,335)
OL1 = Overlay(P12, logo,
\ x=P12.Width-logo.Width-20,
\ y=P12.Height-logo.Height-20,
\ mask=logoT)
return OL1
cadet51
2nd February 2016, 16:25
Hello,
The problem is a file to MP4 and not a PNG file.
Is what I could have you sent my MP4 and see what it is not going to not have this total transparency effect of the red?
I thank you greatly.
raffriff42
2nd February 2016, 23:10
The problem is a file to MP4 and not a PNG file...My suggestion will work with MP4 or anything else - as long as there is a color that can be set as the "transparent" color. In the case of your sample, the transparent color was Black. After manipulating your image to get a fake "mask" or "transparency" clip (where white=opaque and black=transparent), I used the following script: Last=(some video source)
## animation source:
A=ImageSource("FG.png", pixel_type="RGB32").Loop ## foreground image OR VIDEO
M=ImageSource("M.png", pixel_type="RGB32").Loop ## "mask" image OR VIDEO
## set animation speed (animated GIF only)
#A=A.AssumeFPS(5).ConvertFPS(V)
## overlay animation over background, lower right corner:
x=V.Width-A.Width-16
y=V.Height-A.Height-16
Layer(V, A.Mask(M), level=257, x=x, y=y)
If there is no color that is always transparent, this method will not work.
If you obtained your animated logo from a competent artist, he or she should be able to provide you with a matching "mask" or "alpha channel" clip.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.