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)
And now for the image:
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.
+ Reply to Thread
Results 1 to 12 of 12
Thread: AVISynth Overlay Image Help
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:
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.
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
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)
LogoVideo = Overlay(mainvideo,logo,mask=logo.ShowAlpha())
According to taste, you could simplify further and use 'implicit last' for the main video:
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.
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)
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)