View Full Version : Overlay in Avisynth
venkat.siddareddy
27th June 2011, 02:36
Dear friends,
We are trying to use Avisynth as a solution for watermarking the video. What we are doing is to overlay an image with opacity 0.1 after every 100 frames.But overlay is slowing down the video playback. Can some one help me solve this?
Also I would like to know if it is possible to retrieve the watermark if I reduce the opacity to 0.01
Thanks
Venkat
Gavino
27th June 2011, 09:58
overlay is slowing down the video playback.
What do you mean by this?
Slow when playing the script in real-time?
Slow playback after encoding?
:script:
venkat.siddareddy
30th June 2011, 04:41
The playback is slow when I run the script in real time.
Is there a way to overlay an image in realtime?
Gavino
30th June 2011, 09:43
:script: ... and we can advise if it can be speeded up.
Note that Layer (http://avisynth.org/mediawiki/Layer)() is faster than Overlay (http://avisynth.org/mediawiki/Overlay)(), but it only supports RGB32 and YUY2.
IanB
30th June 2011, 13:54
If you just want a simple alpha blend for YV12 you could fudge something up using Merge(). To only attack a portion of the image use Crop() to slice up the image, blend the appropriate bit, then StackVertical/Horizontal to reassemble the pieces.
venkat.siddareddy
1st July 2011, 15:28
Thanks Gavino for the advice. I treid it with Layer and the playback is normal with out any problems.
I managed to write this script and it is working properly. The watermark is almost invisible and it flashes every 10 seconds for a duration of 10 frames.
Please see below for my script.
However I need to address the following two issues.
1)Since the watermark is almost invisible what Avisynth filter will identify this logo. Or tell me any other procedure through which I can identify this logo in a video which is reencrypted or compressed.
2)The second issue is, I would like to rotate the logo at a random location each time. I know there are some examples of x_offset.txt etc in Conditional Reader. But I failed to implement that. Please help me to do these things.
My script follows
V1=AviSource(video.avi)
I1=ImageSource(image.png).ShowAlpha(pixel_type="RGB32")
V2=Layer(V1,I1,"add",10,240,240)
V3=ConditionalFilter(V1, V2, V1, "current_frame%240", "lessthan", "10")
A1=WavSource(audio.wav)
AudioDub(V3,A1)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.