adding 2 seconds of black?

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
Rider4Z
The Machine
Joined: Sun Dec 14, 2003 3:55 am
Status: Larger than life.
Contact:
Org Profile

adding 2 seconds of black?

Post by Rider4Z » Fri Jan 20, 2012 10:58 pm

i remember someone posting a long time ago that there was a script that would add 2 seconds (or so) of black before and after your video for convention purposes.

is that true and if so, any idea what it is? (i knew i should have written it down when i saw it)

User avatar
LantisEscudo
Joined: Thu Mar 08, 2001 5:21 pm
Location: Eastern Massachusetts
Contact:
Org Profile

adding 2 seconds of black?

Post by LantisEscudo » Fri Jan 20, 2012 11:35 pm

Code: Select all

vid=avisource(file)
black=BlankClip(vid, 48)
black++vid++black
You can replace the 48 with 60 if your video is 29.97 instead of 23.976.

User avatar
Rider4Z
The Machine
Joined: Sun Dec 14, 2003 3:55 am
Status: Larger than life.
Contact:
Org Profile

Re: adding 2 seconds of black?

Post by Rider4Z » Fri Jan 20, 2012 11:54 pm

DUDE thanks! :awesome:

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: adding 2 seconds of black?

Post by mirkosp » Sat Jan 21, 2012 9:22 am

You can also do it like this, which might be slightly faster while encoding (though for something this small I doubt it's possible to notice the difference if there is any):

Code: Select all

avisource("file.avi")
blankclip(last,48)+last+blankclip(last,48)
Image

User avatar
LantisEscudo
Joined: Thu Mar 08, 2001 5:21 pm
Location: Eastern Massachusetts
Contact:
Org Profile

Re: adding 2 seconds of black?

Post by LantisEscudo » Sat Jan 21, 2012 11:28 am

mirkosp wrote:You can also do it like this, which might be slightly faster while encoding (though for something this small I doubt it's possible to notice the difference if there is any):

Code: Select all

avisource("file.avi")
last+blankclip(last,48)+last
That won't work; that'll give you two copies of the video with two seconds of black in the middle.

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: adding 2 seconds of black?

Post by mirkosp » Sat Jan 21, 2012 11:31 am

Welp, yeah, brainfart. I humbly apologise. Fixed now.
Image

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

Re: adding 2 seconds of black?

Post by Phantasmagoriat » Sat Jan 21, 2012 6:58 pm

I actually wrote a simple function for this a while back: pad()

Save, and put it in your AviSynth plugins folder. Call it like this:

Code: Select all

avisource("file.avi")
pad(2)                            # adds 2 seconds of black, regardless of framerate, rounded to the nearest frame
pad(frames=24)                    # adds exactly 24 frames of black
pad(3.5, color=$FFFFFF, end=true) # adds 3.5 seconds, white, to the end.  Alternatively you can use pad_end()
:bear:

~Phan
Image
Org Profile | AMVGuide | Phan Picks! | THE424SHOW | YouTube | "Painkiller"

"Effort to Understand; Effort to be Understood; to See through Different Eyes."

Locked

Return to “AviSynth Help”