I'm trying to have an image appear at a certain point in the video. Here is my code:
DirectshowSource("x.wmv", FPS=29.97, ConvertFPS=True)
BilinearResize(640,480,0,0)
And now for the image:
clip="DirectShowSource("x.wmv")
Overlay("x.jpg")
ImageSource("x.jpg", Start=1609, End=1746)
I get the message that a closing quotation mark is missing from the ImageSource section. It's there, I'm somewhat confused on what I'm missing here. Adding a quotation mark after the end time doesn't fix anything.
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 12 of 12
Thread
-
-
What is your exact, complete AVS file? Don't excerpt.
What you have certainly won't work, it creates a new clip on each line, unrelated to the previous. -
ICBM target coordinates:
26° 14' 10.16"N -- 80° 16' 0.91"W -
Yes, the quote just before DirectShowSource is wrong. Overlay() doesn't take the name of a file. You want something like:
DirectShowSource("x.wmv")
ovl=ImageSource("x.jpg")
Trim(0,1608)+Trim(1609,1746).Overlay(ovl)+Trim(174 7,0)
And note that DirectShowSource isn't always frame accurate.Last edited by jagabo; 25th Apr 2012 at 13:05.
-
That's what I needed, thank you. Now I just have to figure out how to play the whole movie with the overlay showing up at that time. Like you said, it isn't frame accurate.
-
Does FFMEGSource handle WMV? Let me check...
Edit: Yes, I think it does:
http://code.google.com/p/ffmpegsource/
http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-avisynth.html -
Nearly everything works great now. Thanks everyone. The only problem I have is I decided to have it be a PNG image, with a transparent background, except a black box shows up as the background. I assumed this was saved as RGB32 already or something, So I can't use the ShowAlpha option.
-
Can you redo the png image in your image editing program (gimp, photoshop)? You won't be able to use transparency without it.
Several ways to do this, probably one of the easier ways overlay with showalpha. Create your png overlay with alpha the same dimensions as video, position the overlay where you want in your image program , then use trim to join sections that have the overlay to sections that don't have the overlay
Code:mainvideo=FFMpegSource2("file.wmv", atrack=-1) logo=ImageSource("logo.png",pixel_type="RGB32") Overlay(mainvideo,logo,mask=logo.ShowAlpha()) LogoVideo=last mainvideo.Trim(0,1608) ++ LogoVideo.Trim(1609,1746) ++ mainvideo.Trim(1747,0)
-
This could be replaced simply by
LogoVideo = Overlay(mainvideo,logo,mask=logo.ShowAlpha())
According to taste, you could simplify further and use 'implicit last' for the main video:
Code:FFMpegSource2("file.wmv", atrack=-1) logo=ImageSource("logo.png",pixel_type="RGB32") LogoVideo = Overlay(logo,mask=logo.ShowAlpha()) Trim(0,1608) ++ LogoVideo.Trim(1609,1746) ++ Trim(1747,0)
-
That worked well. After that I had a bunch of bad luck.
Just trying to set the placement of the PNG, and, forgot to save, when I did it perfectly the first time.
Trim(0,20088)+Trim(20089,20129).Overlay(ovl)+Trim( 20130,0)
I looked directly at the code, copied it pefectly with my custom text, so I was certain I would put:
("x.png", x=50, y=50) -
The filename should not be present in the Overlay command - the connection to the file has already been made by ImageSource.
In the quoted code you would use
Trim(0,20088)+Trim(20089,20129).Overlay(ovl, x=50, y=50)+Trim(20130,0)
or if using the code suggested by poisondeathray and me,
... Overlay(logo,mask=logo.ShowAlpha(), x=50, y=50) -
Is there any software for video capturing that automatically add Text or logo overlay on video? Like this videocapx http://www.videocapx.com/ ?
Last edited by Yountraj; 20th Sep 2012 at 09:52.
Similar Threads
-
AviSynth Overlay and Trim Help
By NMeade in forum Newbie / General discussionsReplies: 20Last Post: 1st Apr 2012, 07:53 -
Using AVISynth to overlay PNG subtitles?
By csdesigns in forum SubtitleReplies: 8Last Post: 3rd Feb 2012, 11:36 -
avisynth - overlay fadein from transparent
By doma79 in forum EditingReplies: 12Last Post: 6th Dec 2011, 11:38 -
AviSynth Audio Overlay
By legocrazy1 in forum EditingReplies: 7Last Post: 14th Jul 2010, 10:01 -
Help with Avisynth overlay
By WAKA in forum Newbie / General discussionsReplies: 12Last Post: 14th Jul 2009, 12:37