I have a .mpg file that I wanna encode with MeGUI to x264 .mkv. I know how to do that, but I also wanna add a watermark(lets say that I have a .jpg or .png picture on my HDD). So I wanna know how to add it to the video(and if possible to a specific time in the video). I used Google but all I found was some shitty programs with which I need to re-encode the previously encoded x264 .mkv and that destroys the video quality. That is why I'm asking if it is possible to add the watermark when I'm encoding the video from the .mpg with MeGUI so that it needs only one encode. I hope you understand what I want
btw the current script is :
Code:LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll") DGDecode_mpeg2source("E:\New folder\file.d2v") Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll") Yadif(order=1) crop( 2, 2, -2, -2) Spline36Resize(704,400) # Spline36 (Neutral) #denoise
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 30 of 37
Thread
-
-
Use the Overlay() filter.
http://avisynth.org/mediawiki/Overlay
Use an alpha mask for transparency. Here's a thread with some use of Overlay():
https://forum.videohelp.com/threads/297982-Adding-Transparent-Logos-onto-VOB-FilesLast edited by jagabo; 5th Jul 2011 at 14:42.
-
Thank you very much I understood everything except how to add it at a precise time. I want it to appear somewhere in the beginning, then I want that the watermark disappears after, lets say 10 seconds, and then I want it to appear somewhere in the middle of the video and then that it disappears again after 5 seconds. How do I do that ?
-
You can use Trim() to divide up your video into segments that have or don't have the watermark, and then join them with "++" or aligned splice
A ++ B ++ C ++ D
This is an example using ReplaceFramesSimple
https://forum.videohelp.com/threads/315776-Adding-Watermark-To-Video-using-Megui -
Thank you very much for your help. I managed to do it using ReplaceFramesSimple
-
You mean animated? Like a few degrees per frame?
http://avisynth.org.ru/rotate/rotate.html -
Yes, animated. When I use this rotate plugin, it just rotates the entire picture with the watermark. There is no animated rotation of the watermark.
-
-
When I add your line, nothing works anymore The watermark is not animated, and it doesn't disappear when it should.
The current script is :
Code:LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\RemapFrames.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Rotate.dll") a1=DGDecode_mpeg2source("E:\New folder\1.d2v") Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll") a2=ImageReader("E:\New folder\watermark 1.png") a3=ImageReader("E:\New folder\watermark 1.png",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32") a4=Overlay(a1,a2,mask=a3, x=20, y=20) ReplaceFramesSimple(a1, a4, mappings="[26 345][1250 1920][2699 2999]") Animate(a4, 0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0) Yadif(order=1) crop( 2, 2, -2, -2) Spline36Resize(704,400) # Spline36 (Neutral) #denoise
-
You can't just throw the line in anywhere. Add Animate to the watermark (a2) and its alpha channel (a3).
-
Like this ?
Code:LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\RemapFrames.dll") LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Rotate.dll") a1=DGDecode_mpeg2source("E:\New folder\1.d2v") Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll") a2=ImageReader("E:\New folder\watermark 1.png") a3=ImageReader("E:\New folder\watermark 1.png",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32") a4=Overlay(a1,a2,mask=a3, x=20, y=20) Animate(a2, 0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0) Animate(a3, 0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0) ReplaceFramesSimple(a1, a4, mappings="[26 345][1250 1920][2699 2999]") Yadif(order=1) crop( 2, 2, -2, -2) Spline36Resize(704,400) # Spline36 (Neutral) #denoise
Rotate : image format must be RGB32 or YV12! -
make separate video with animated logo/overlay - use this video in loop with overlay, this should be faster than complicated script
-
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\RemapFrames.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Rotate.dll")
a1=DGDecode_mpeg2source("E:\New folder\1.d2v")
Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll")
a2=ImageReader("E:\New folder\watermark 1.png",pixel_type="RGB32").Animate(0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0)
a3=ImageReader("E:\New folder\watermark 1.png",pixel_type="RGB32").ShowAlpha(pixel_type="R GB32").Animate(a3, 0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0)
a4=Overlay(a1,a2,mask=a3, x=20, y=20)
ReplaceFramesSimple(a1, a4, mappings="[26 345][1250 1920][2699 2999]")
Yadif(order=1)
crop( 2, 2, -2, -2)
Spline36Resize(704,400) # Spline36 (Neutral)
#denoise -
I too was wondering how to do this and ended up with:
Code:LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\rotate\Rotate.dll") #http://avisynth.org.ru/rotate/rotate.html image = ImageReader("logo.png",pixel_type="RGB32") #Image imageMask = ImageReader("logo.png",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32") #Mask video = avisource("test.avi") #VideoSource #rotate logo&mask and then overlay them onto the clip function myOverlay(clip video, clip image, clip imageMask, int rot) { return Overlay(video,image.Rotate(rot),mask=imageMask.Rotate(rot)) } length = video.framecount-1 #number of frames in the clip; -1 since Avisynth starts count at 0 Animate(video, 0, length, "myOverlay", image, imageMask, 0, image, imageMask, length)
-
Thanks you for your help I tried your script and it gave me an error :
I don't know what "a3" means
Code:a3=ImageReader("E:\New folder\watermark 1.png",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32").Animate(a3, 0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0)
Code:a3=ImageReader("E:\New folder\watermark 1.png",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32").Animate(0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0)
-
@jagabo: shouldn't the deinterlacer be called before doing any overlay&co? (otherwise it might cause problems)
@Alienware: try:
Code:LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\rotate\Rotate.dll") #http://avisynth.org.ru/rotate/rotate.html LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindex\DGDecode.dll") Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll") video = DGDecode_mpeg2source("E:\New folder\file.d2v") video = video.Yadif(order=1) video = video.crop( 2, 2, -2, -2) video = video.Spline36Resize(704,400) image = ImageReader("logo.png",pixel_type="RGB32") imageMask = ImageReader("logo.png",pixel_type="RGB32").ShowAlpha(pixel_type="RGB32") function myOverlay(clip video, clip image, clip imageMask, int rot) { return Overlay(video,image.Rotate(rot),mask=imageMask.Rotate(rot)) } length = video.framecount-1 Animate(video, 0, length, "myOverlay", image, imageMask, 0, image, imageMask, length) ConvertToYv12()
-
Thanks you very much, Selur Your script works, but how do I specify these options now ?
1. The position of the watermark ? (now the watermark is located in the upper left corner)
2. The opacity of the watermark ?
3. And the most important is how do I specify on what frames do I want that watermark ? (I had this line for that purpose before - ReplaceFramesSimple(a1, a4, mappings="[26 345][1250 1920][2699 2999]")
@jagabo
Where is the problem in your script ? -
1&2-> You need to adjust the Overlay call accordingly (should be simple, if you read: http://avisynth.org/mediawiki/Overlay)
3-> you got different options:
a. you could simply add mutiple Animate calls, atm. there is a single Animate call which runs for 0 to length but you could do three calls each staring and ending at the frames you like
b. you could use trim and split the video in multiple parts, call Animate on each part and then join them afterwards
c. you could use multiple ApplyRange calls
d. you could mix jagabos and my script
All in all, in think with a bit time spend reading the Avisynth documentation and trying to unterstand how jagabo and I approached the problem you should be fine.
Cu Selur -
What you all appear to be missing is that you don't need to apply Animate to Rotate - the function itself has a built-in animation feature using the start, end and endAngle parameters. In fact, jagabo's script with
Animate(0, 180, "Rotate", 0, 0, 0, 0, 360, 0, 0, 0)
has no effect since the start and end frames passed to Rotate are always 0.
Also, you can do the rotation once on the logo clip before splitting off the mask rather than doing it twice (and no need to load the image twice either).
Try this:
Code:... # LoadPlugin etc a1=DGDecode_mpeg2source("E:\New folder\1.d2v").Yadif(order=1) a2=ImageReader("E:\New folder\watermark 1.png",end=a1.Framecount-1,pixel_type="RGB32") a2=a2.Rotate(endangle=360) # or some other angle, say 3600 for 10 rotations a3=a2.ShowAlpha() a4=Overlay(a1,a2,mask=a3, x=20, y=20) ReplaceFramesSimple(a1, a4, mappings="[26 345][1250 1920][2699 2999]") crop( 2, 2, -2, -2) Spline36Resize(704,400)
-
It worked for me? Although it stopped at 360 degrees (eg, if I asked for 720 degrees). I didn't realize it had its own animation feature though.
I just looked again and the version of Rotate() I have doesn't have an animation feature:
Rotate (clip, float "angle", int "width", int "height", int "color")Last edited by jagabo; 6th Jul 2011 at 18:41.
-
-
Thanks. I thought I had downloaded the latest but somehow got version 1.0. Just updated to 1.3...
-
my version too did not have the endAngle Parameter,.. (but mine really was old)
-
My way use AviSynth also but instead rendering each frame with script You pre-rendering animated sequence then You overlay this sequence on video - this should be much faster than re-rendering each frame from scratch. - just split script on two independent - animate image with rotate, render to external images or avi, then use this as animation placed over video. that all - One big, complex script will be slow - i know this from my experience, especially if there is need to make high quality ie introducing to video some oversampling (pixel fractional scrolling or animation) - for decent quality you must work with videos at least 4 times oversampled thus you are able to represent very fine and smooth motion without stutter and jaggies
but this is only advice based on some experience from past -
-
very useful post
what should i do to change the script for h264 video and *.mkv container.
i'm newbie here.
Similar Threads
-
How to add a watermark to a movie.
By aligonso in forum Newbie / General discussionsReplies: 13Last Post: 31st Mar 2012, 04:28 -
How to add a watermark in a .mkv file with Avisynth?
By imam2007 in forum Video ConversionReplies: 1Last Post: 20th Nov 2011, 16:04 -
how to add watermark in vedio
By ShrinkDWorld in forum Newbie / General discussionsReplies: 5Last Post: 30th Sep 2011, 20:31 -
Avisynth watermark Scaleing Help!!!!!
By tater7 in forum EditingReplies: 5Last Post: 18th Sep 2011, 20:41 -
How to add watermark? Please help
By lana in forum Newbie / General discussionsReplies: 2Last Post: 2nd Dec 2010, 04:18