timing picute in a video

This forum is for questions and discussion of all the aspects of handling your footage. If you have questions about capturing/ripping footage, AviSynth, or compression/encoding/converting, look here.

timing picute in a video

Postby DorDahan » Fri Apr 22, 2011 8:41 pm

i have a picture in want to put in a video so i made this code in avs file:
video = DirectShowSource("file.mkv",fps=23.976,convertfps=true)
image = Imagesource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\pic1.png", pixel_type="RGB32")
Overlay(video, image, x=170, y=90, mask=image.ShowAlpha())

now how i time it so i will be from mintune X second X or frame X to frame X
please help me and give me the whole code because im really nobbie with this stuff thanks :awesome:

[MOD258: Filename redacted, please read the rules.]
DorDahan
 
Joined: 22 Apr 2011

Re: timing picute in a video

Postby Zarxrax » Sat Apr 23, 2011 12:29 pm

The easiest way would probably be to use Trim() commands to break your main video into several parts, and then just apply the overlay to the part that you want, and then join the parts back together.

Code: Select all
video = DirectShowSource("file.mkv",fps=23.976,convertfps=true)
part1 = video.Trim(0,1000)
part2 = video.Trim(1000,2000)
part3 = video.Trim(2000,0)
image = Imagesource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\pic1.png", pixel_type="RGB32")
Overlay(part2, image, x=170, y=90, mask=image.ShowAlpha())
Part1 ++ Overlay(part2, image, x=170, y=90, mask=image.ShowAlpha()) ++ Part3


In this example, the overlay will appear from frames 1000 to 2000 of the video.

[MOD258: Fixed the script with the missing line.]
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

Re: timing picute in a video

Postby Zarxrax » Sat Apr 23, 2011 12:30 pm

Oops, the last line should actually be:

Part1 ++ Overlay(part2, image, x=170, y=90, mask=image.ShowAlpha()) ++ Part3
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

Re: timing picute in a video

Postby mirkosp » Sat Apr 23, 2011 12:45 pm

Just an error with those trims, they should be more like:
Code: Select all
part1 = video.Trim(0,999)
part2 = video.Trim(1000,2000)
part3 = video.Trim(2001,0)

To have it overlayed from frame 1000 to 2000. You're getting repetition of frame 1000 and 2000 otherwise.
Image
User avatar
mirkosp
MODkip
 
Joined: 24 Apr 2006
Location: Gallarate (VA), Italy
Status: (」・ワ・)」(⊃・ワ・)⊃

Re: timing picute in a video

Postby Zarxrax » Sat Apr 23, 2011 1:14 pm

Oh, for some reason I was thinking that the values should overlap.
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

Re: timing picute in a video

Postby DorDahan » Sat Apr 23, 2011 1:48 pm

can someone give me the lastest updated code i should input into virtualdubmod? because i didnt get a think ...
DorDahan
 
Joined: 22 Apr 2011

Re: timing picute in a video

Postby DorDahan » Sat Apr 23, 2011 1:53 pm

i puted this code:
Code: Select all
LoadPlugin("C:\VirtualDubMod\plugins\immaavs.dll")
video = DirectShowSource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\Dragon Ball Z Kai 001 [720p].mkv",fps=23.976,convertfps=true)
part1 = video.Trim(0,999)
part2 = video.Trim(1000,2000)
part3 = video.Trim(2001,0)
image = Imagesource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\pic1.png", pixel_type="RGB32")
Overlay(part2, image, x=170, y=90, mask=image.ShowAlpha())
Part1 ++ Overlay(part2, image, x=170, y=90, mask=image.ShowAlpha()) ++ Part3


i didn't get any errors but i cant see the picuture now, how i decied in which frames i will be able to see it?
DorDahan
 
Joined: 22 Apr 2011

Re: timing picute in a video

Postby DorDahan » Sat Apr 23, 2011 2:07 pm

sorry for all the replys but i made a new code:
LoadPlugin("C:\VirtualDubMod\plugins\immaavs.dll")
m1 = DirectShowSource("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\Dragon Ball Z Kai 001 [720p].mkv")
m2 = immareadpic("C:\Users\Dor\Desktop\פרקי דרגון בול\נקיים\pic1.png").changefps(3000).fadein(0).fadeout(0)
overlay (m1, m2, mode="blend", mask=showalpha(m2), x=170, y=90)

now its shows the logo in my video but, i still cant determine when its start i can tell it to end in (changeframe)
DorDahan
 
Joined: 22 Apr 2011

Re: timing picute in a video

Postby DorDahan » Sat Apr 23, 2011 2:33 pm

exctally i fixed it.
DorDahan
 
Joined: 22 Apr 2011

Re: timing picute in a video

Postby DorDahan » Sat Apr 23, 2011 4:34 pm

ok a whole new question.. i want to put antoher picture and i tried this code
Code: Select all
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\פרקי דרגון בול\נקיים\pic3.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

and now i cant see both of the picture what wrong with it?
DorDahan
 
Joined: 22 Apr 2011

Re: timing picute in a video

Postby 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: 01 Apr 2001
Location: Concord, NC

Re: timing picute in a video

Postby 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?
User avatar
Zarxrax
 
Joined: 01 Apr 2001
Location: Concord, NC

Re: timing picute in a video

Postby DorDahan » Sat Apr 23, 2011 6:31 pm

same frame different range.
DorDahan
 
Joined: 22 Apr 2011

Re: timing picute in a video

Postby 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: 22 Apr 2011

Re: timing picute in a video

Postby 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
DorDahan
 
Joined: 22 Apr 2011

Next

Return to Footage Help

Who is online

Users browsing this forum: No registered users and 1 guest