timing picute in a video

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
User avatar
Zarxrax
Joined: Sun Apr 01, 2001 6:37 pm
Contact:
Org Profile

Re: timing picute in a video

Post by Zarxrax » Sat Apr 23, 2011 5:51 pm

Ok, first of all, the 2 overlay lines (2 from the bottom) are unnecessary and redundant.
Next, you should combine the last 2 lines with ++

User avatar
Zarxrax
Joined: Sun Apr 01, 2001 6:37 pm
Contact:
Org Profile

Re: timing picute in a video

Post by Zarxrax » Sat Apr 23, 2011 5:53 pm

Oh wait, now that I look at your code, that's not going to be what you want.
You want to put both pics on the same range or frames?

DorDahan
Joined: Fri Apr 22, 2011 7:55 pm
Org Profile

Re: timing picute in a video

Post by DorDahan » Sat Apr 23, 2011 6:31 pm

same frame different range.

DorDahan
Joined: Fri Apr 22, 2011 7:55 pm
Org Profile

Re: timing picute in a video

Post by DorDahan » Sat Apr 23, 2011 6:33 pm

not exactly on the same frames but on few frames they will be together but they must be in different range.
the pictures are different if that's matter.

DorDahan
Joined: Fri Apr 22, 2011 7:55 pm
Org Profile

Re: timing picute in a video

Post by DorDahan » Sat Apr 23, 2011 6:36 pm

when i use this code:
LoadPlugin("C:\VirtualDubMod\plugins\immaavs.dll")
video = DirectShowSource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\[www.bafsubs.tk]Dragon_Ball_Kai_E1.mkv",fps=23.976,convertfps=true)
part1 = video.Trim(0,300)
part2 = video.Trim(301,404)
part3 = video.Trim(405,0)
part4 = video.Trim(0,300)
part5 = video.Trim(301,404)
part6 = video.Trim(405,0)
image = Imagesource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\pic3.png", pixel_type="RGB32")
image2 = Imagesource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\dbzkailogo1.png", pixel_type="RGB32")
Overlay(part2, image, x=130, y=180, mask=image.ShowAlpha())
Overlay(part5, image2, x=-130, y=-180, mask=image.ShowAlpha())
Part1 ++ Overlay(part2, image, x=130, y=180, mask=image.ShowAlpha()) ++ Part3
Part4 ++ Overlay(part5, image2, x=-130, y=-180, mask=image.ShowAlpha()) ++ Part6
i get error that says mask and overlay must have the same image size.(wight is not the same) line10

User avatar
Zarxrax
Joined: Sun Apr 01, 2001 6:37 pm
Contact:
Org Profile

Re: timing picute in a video

Post by Zarxrax » Sat Apr 23, 2011 6:48 pm

Yes, you image that you are overlaying must be the same size as the video.

Try this:

Code: Select all

video = DirectShowSource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\[www.bafsubs.tk]Dragon_Ball_Kai_E1.mkv",fps=23.976,convertfps=true)
part1 = video.Trim(0,300)
part2 = video.Trim(301,404)
part3 = video.Trim(405,0)
image = Imagesource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\pic3.png", pixel_type="RGB32")
video = part1 ++ Overlay(part2, image, x=130, y=180, mask=image.ShowAlpha()) ++ part3

part4 = video.Trim(0,300)
part5 = video.Trim(301,404)
part6 = video.Trim(405,0)
image2 = Imagesource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\dbzkailogo1.png", pixel_type="RGB32")
Overlay(part5, image2, x=-130, y=-180, mask=image.ShowAlpha())
part4 ++ Overlay(part5, image2, x=-130, y=-180, mask=image.ShowAlpha()) ++ part6
You will just ajust the frame numbers in the trims to set which frame range you want the images on.

User avatar
Phantasmagoriat
Joined: Mon Feb 06, 2006 11:26 pm
Status: ☁SteamPunked≈☂
Contact:
Org Profile

Re: timing picute in a video

Post by Phantasmagoriat » Sat Apr 23, 2011 6:49 pm

Well, you could use my Range() function. (It doesn't just apply filters, it also does Clip Replacement)

Code: Select all

VID = directshowsource("Your_Base_Video.mp4")
IMG = imagesource("Your_Image.jpg")
OVL = overlay(VID, IMG)

VID
range( startframe,endframe, OVL, fadein,fadeout )
EDIT: for multiple images:

Code: Select all

IMG1 = imagesource("IMAGE1.jpg", pixel_type="RGB32")
IMG2 = imagesource("IMAGE2.jpg", pixel_type="RGB32")

directshowsource("VIDEO.mkv",fps=23.976,convertfps=true)
range( 301,404, Overlay(last, IMG1, x=130, y=180, mask=IMG1.ShowAlpha()), 5,5)
range( 301,404, Overlay(last, IMG2, x=-130, y=-180, mask=IMG2.ShowAlpha()), 5,5)
PLAY FREEDOOM!! | Phan Picks! | THE424SHOW | YouTube | "Painkiller" | Vanilla MIDI's
"Effort to Understand; Effort to be Understood; to See through Different Eyes."

DorDahan
Joined: Fri Apr 22, 2011 7:55 pm
Org Profile

Re: timing picute in a video

Post by DorDahan » Sat Apr 23, 2011 10:13 pm

Zarxrax, i still get error on this line:

Code: Select all

Overlay(part5, image2, x=-130, y=-180, mask=image.ShowAlpha())
something about wight. like i said before.
Phantasmagoriat, i also get error, "there is no function named range"

User avatar
Phantasmagoriat
Joined: Mon Feb 06, 2006 11:26 pm
Status: ☁SteamPunked≈☂
Contact:
Org Profile

Re: timing picute in a video

Post by Phantasmagoriat » Sat Apr 23, 2011 10:23 pm

DorDahan wrote:Phantasmagoriat, i also get error, "there is no function named range"
You need to put Range().avsi in your plugins folder.

(Usually "C:\Program Files (x86)\AviSynth 2.5\plugins" or "C:\Program Files\AviSynth 2.5\plugins")
PLAY FREEDOOM!! | Phan Picks! | THE424SHOW | YouTube | "Painkiller" | Vanilla MIDI's
"Effort to Understand; Effort to be Understood; to See through Different Eyes."

User avatar
Zarxrax
Joined: Sun Apr 01, 2001 6:37 pm
Contact:
Org Profile

Re: timing picute in a video

Post by Zarxrax » Sun Apr 24, 2011 12:15 am

DorDahan wrote:Zarxrax, i still get error on this line:

Code: Select all

Overlay(part5, image2, x=-130, y=-180, mask=image.ShowAlpha())
something about wight. like i said before.
Phantasmagoriat, i also get error, "there is no function named range"
As I said, the overlay image must be the same size as the video

Locked

Return to “AviSynth Help”