Hello,
i just started ripping using megui to mkv x264 rips. I was wondering if i can add watermark while ripping. Using vdub logo filter or something i have seen a sample on few web sites but couldn't able to get it work.
this what i got so far
DGDecode_mpeg2source("C:\videos/VTS_02_1.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate(hybrid=3)
crop( 4, 60, -4, -54)
LanczosResize(640,272) # Lanczos (Sharp)
Undot() # Minimal Noise
{
LoadVirtualdubPlugin("C:\Program Files (x86)\VirtualDub\Plugins"
\ +"\logo.vdf", "_VD_Logo", 1)
return clip._VD_Logo(default(x,0), default(y,0), default(alpha,128),
\ default(transparent,true)?1:0, default(xr,0), default(xg,0),
\ default(xb,255),default(tolerance,0), default
\ (filename,VirtualDub_plugin_directory+"\logo.bmp") ,
\ default(animate,false)?1:0, default(start,0), default(duration,0),
\ default(loops,0),default(fadeinlen,0),
\ default(fadeoutend,200), default(fadeoutlen,0))
}
ConvertToRGB()
VD_logo(0,0,128,true,0,0,0,0,"C:\Pictures\logo.bmp ",false,100,500,0,100,500,100)
ConvertToYUY2()
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 30
Thread
-
-
Most all VirtualDub logo filters are to remove those incredibly irritating logos, not add them. But someone here may have an idea.
'Ripping' is generally the process of making an exact copy of a file, usually as in transferring a DVD VIDEO_TS folder to your computer's hard drive. What you are doing appears to be encoding or re-encoding the file to a different format.
And that's not editing. Moving you to Newbie/General Forum.
And welcome to our forums.
EDIT: You might check this discussion: http://neuron2.net/board/viewtopic.php?t=921 Also this: http://neuron2.net/logo/logo.html -
A=ImageSource("C:\Path\To\Logo.bmp")
A=A.ConvertToYV12()
B=MPEG2Source("C:\videos\VTS_02_1.d2v")
Overlay(B,A,X=xxx,Y=yyy)
where xxx and yyy are the coordinates where it should be applied. If you just want it in the upper left corner, you don't need 'X=xxx,Y=yyy'. And you don't need the ColorMatrix filter, unless maybe you're starting with a hi-def source and downsizing to standard def. Let us know if you have any problems. However, like redwudz I hate user applied logos with a passion. Unless you have a very good reason for applying one, I'd recommend forgetting about it.
http://avisynth.org/mediawiki/Overlay
Also, you should always open your scripts in VDub(Mod) for testing. It'll give out with an error message to help pinpoint what's wrong. You just telling us that it didn't work isn't good enough. In the case of your script above, it would have immediately pointed to the first line because you have a slash facing the wrong way:
DGDecode_mpeg2source("C:\videos/VTS_02_1.d2v", info=3) -
Another tool to help you position and preview the image in the script, with trial and error, is AvsP.
As well, I notice in your script, and I'm assuming, you're dealing with a wide screen film source.
As for this line be careful:
tfm(order=1).tdecimate(hybrid=3)
Your audio could end up out of sync as there may be too slow a framerate for it. If so, use hybrid=1 instead.
And for:
crop( 4, 60, -4, -54)
LanczosResize(640,272)
I'd need to see the source, but it seems off to me. Either you're not cropping enough, or you could add more pixels to the height. It could still work, but may not be as efficient an encode or could throw off the aspect ratio. Like I said, I can't see the source so I'm guessing.I hate VHS. I always did. -
it did convert without a problem but then when i looked at the video after converting there was no watermark
-
Originally Posted by rippergreat
You should always preview your script before encode, so you don't waste time. If the watermark isn't in the preview, it obviously isn't going to be in the final conversion. You preview it in mpc, avsp, vdub etc... or even the megui preview window.
What kind of watermark? Is it a solid .bmp or does it have alpha channel (transparency)? Is it the same size of the video frame or different? Do you want it on all the frames or just a few? -
this was my script
DGDecode_mpeg2source("C:\Documents\Videos\VTS_02_1 .d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate(hybrid=3)
function VD_Logo(clip clip, int "x", int "y", int "alpha", bool "transparent",
\ int "xr", int "xg", int "xb", int "tolerance", string "filename",
\ bool "animate", int "start", int "duration", int "loops",
\ int "fadeinlen", int "fadeoutend", int "fadeoutlen")
{
LoadVirtualdubPlugin("C:\VirtualDub\Plugins"
\ +"\logo.vdf", "_VD_Logo", 1)
return clip._VD_Logo(default(x,0), default(y,0), default(alpha,128),
\ default(transparent,true)?1:0, default(xr,0), default(xg,0),
\ default(xb,255),default(tolerance,0), default
\ (filename,""),
\ default(animate,false)?1:0, default(start,0), default(duration,0),
\ default(loops,0),default(fadeinlen,0),
\ default(fadeoutend,200), default(fadeoutlen,0))
}
ConvertToRGB()
VD_logo(382,435,240,true,0,0,0,10,"C:\VirtualDub\P lugins\T.bmp",false,1067,0,0,30,1419,13)
ConvertToYV12()
crop( 4, 58, -4, -54)
LanczosResize(640,272) # Lanczos (Sharp)
Undot() # Minimal Noise -
Why do you insist on using VirtualDub's logo filter? Use AviSynth's Overlay() instead. It's much simpler. Here's a script including an alpha mask:
myvideo=AVISource("source.avi")
myoverlay=ImageSource("Logo.bmp")
mymask=ImageSource("Mask.bmp")
Overlay(myvideo, myoverlay, 48, 48, mymask)
Here's a sample with a simple 50 percent opacity:
myvideo=AVISource("source.avi")
myoverlay=ImageSource("Logo.bmp")
Overlay(myvideo, myoverlay, 48, 48, opacity=0.5) -
Originally Posted by jagabo
DGDecode_mpeg2source("C:\Documents\Videos\VTS_02_1 .d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate(hybrid=3)
myoverlay=ImageSource("Logo.bmp")
mymask=ImageSource("Mask.bmp")
Overlay(myvideo, myoverlay, 48, 48, mymask)
crop( 4, 58, -4, -54)
LanczosResize(640,272) # Lanczos (Sharp)
Undot() # Minimal Noise -
Close, but remove myvideo from the Overlay function since you are using the default video:
Overlay(myoverlay, 48, 48, mymask) -
Mask is an alpha channel. It's an image that indicates how transparent each pixel of the logo is (same size as the logo). Black is completely transparent, white is completely opaque and grays in between are varying levels of transparency.
Note, I added a simple opacity example earlier. -
Originally Posted by rippergreat
http://avisynth.org/mediawiki/SelectRangeEvery
http://avisynth.org/mediawiki/Fade
If you can't figure out how to use them yourself, give us your current script, how often you want the logo to appear and how long you want it to stay on. And if you want it faded, how much time for the fade in/out? The framerate of the video would also be helpful. -
You can also trim your video into segments and apply the overlay to only chosen segments:
Code:myvideo=AVISource("source.avi") myoverlay=ImageSource("Logo.bmp") seg1=trim(myvideo, 0, 99) #frames 0 to 99 seg2=trim(myvideo, 100, 0) #frames 100 to end return(Overlay(seg1, myoverlay, 48, 48, opacity=0.5)+seg2)
-
You have to define what "myvideo" is, so instead of AVISource, use MPEG2Source in your example:
DGDecode_mpeg2source("C:\Documents\Videos\VTS_02_1 .d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate(hybrid=3)
myvideo=last
So the stuff before the last line refers to the input video, and from now on it's called "myvideo" for the rest of the script. It's just a variable name. You could have just as easily called it something else -
Originally Posted by poisondeathray
-
Yes in that example script, the 3 previous lines refer to your video. You still have to add the other stuff like cropping and overlay, trim etc... You might even add the resize and crop before the "myvideo=last" line, depending on what dimensions your overlay was
If you called it "mysupercoolvideo=last", those lines would now be called "mysupercoolvideo" -
If you import a video without naming it AviSynth assigns it the name "last". If you use a filter that requires a video segment but don't explicitly specify which video to use it wil use last. So
Code:Mpeg2Source("video.m2v") Crop(8,0,-8,-0) #(implied return of last)
Code:last=Mpeg2Source("video.m2v") last=Crop(last,8,0,-8,-0) return(last)
-
Originally Posted by manono
AVISource("D:\2009-05-31_17.27.38.avi", audio=false)
myoverlay=ImageSource("D:\cef\images_cef\logo.png" )
Overlay(myoverlay, 0, 400, opacity=0.2)
Thank you -
You're not being specific enough. How long is the logo to be on screen each time? How long is the FadeIn/Out to last? How long between logo 'appearances'?
Get stickboy's ApplyEvery plugin for AviSynth here:
http://avisynth.org/stickboy/
Convert everything to RGB32 and try some variation of this script:
LoadPlugin("C:\Path\To\ApplyEvery.dll")
A=AVISource("D:\2009-05-31_17.27.38.avi", audio=false)
B=ImageSource("D:\cef\images_cef\logo.png",End=249 ) #logo onscreen for 10 seconds at 25fps
A=A.ConvertToRGB32(Matrix="PC.601")
B=B.ConvertToRGB32(Matrix="PC.601")
B=B.FadeIO0(25) #fading in and out for 1 second each at 25fps
ApplyEvery(A,1500,"Layer(B,X=0,Y=40,Level=128)") #logo applied every 1500 frames (every minute at 25fps), adjust level for how strong you want the logo at max. 257 is default and full strength.
ConvertToYV12(Matrix="PC.601") #or whatever colorspace you need for the output
http://avisynth.org/mediawiki/Layer -
Originally Posted by manono
-
Originally Posted by madeinlisboa
-
I appreciate your help. Thank you again. I asked that because in the future I'm going to convert files from HD digital video cameras to mp4 (x264), and I'm afraid that it will take ages to encode them if color conversion is applied.
Shall I keep using the same color spaces on those kind of files?
Again, thank you for the time you spared. -
I decided to use Layer instead of Overlay, because it worked - when not being used, the logo was invisible. When using Overlay I kept getting a big black square when there shouldn't have been anything. I was probably doing something wrong, though. I think x264 also uses YV12, so you'll still need colorspace conversions. There's just no way around it when putting RGB pics onto YV12 video. As I said earlier in this thread, I don't approve of watermarks anyway. If you're so worried about the slower encoding, don't use them.
If you're about to switch to encoding to x264 using Hi-Def sources, the slowdown caused by the colorspace conversions is the least of your worries. Much more of the slower encoding will be caused by using those Hi-Def sources. The best thing you can do is to buy yourself a nice new i7 CPU. -
I need the watermarks. They are required to personalize/copyright some eLearning videos I'm about to convert for a friend.
Anyway, you've been a great help!
Similar Threads
-
adding watermark as a subtitle
By zammil in forum SubtitleReplies: 8Last Post: 20th Nov 2010, 00:45 -
adding watermark to videos
By zammil in forum Newbie / General discussionsReplies: 7Last Post: 16th Nov 2010, 22:19 -
Adding watermark to DVD
By carlmart in forum Authoring (DVD)Replies: 8Last Post: 3rd Aug 2010, 12:28 -
adding watermark on video
By 3390 in forum Newbie / General discussionsReplies: 5Last Post: 27th Feb 2008, 05:13 -
Adding watermark to FLV
By whoisquilty in forum MacReplies: 3Last Post: 11th Jan 2008, 18:20