Quantcast Adding Black "Frames" to the Beginning and the End of Video? - digitalFAQ.com Forums [Archives]
11-24-2003, 07:38 AM
incredible incredible is offline
Free Member
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
Yesterday i did a capture "L.A. Story" and what I recognised in the past was that my Stand Alone Player "overjumps" like 5-10 frames at the beginning of a mpeg stream when starting playback. And also stops ca. 5-10 frames before the stream on the CD-R really ends.
If an encoding is done on a capture where the movie starts exactly at frame 0 I always was suffering under these 5-10 Frames "overjump" at the beginning according to my StandAlone, also the "cut"-off of 5-10 frames at the end.

So yesterday I wrote a function you can just place in every script you want which adds x black Frames at the beginning and the same x black Frames to the end ... also automatically there will be a fade in from the black frames to the real stream beginning and also from the stream end to the black x Frames.

Use the Command as following:

addblack(int [No.frames] )

So addblack(50) will add 50 black frames to the beginning and the end of the stream including the mentioned fade-in and fade-out.

addblack() just uses 50 frames as default.

I testet it yesterday on several different inputs. Different according to Colorspace, Audiorate, Size and so on.

This function is source adapitve! This means it automatically detects the colorspace, width, heigth, fps, size ... etc. which are needed to generate the blankclips so it will be compatible to the source to which it will be added.
So no matter where you place it, but I would recommend to place it after the Addborders() or GripBorders() command in your script.

So safe this function as "Addblack.avsi" to your Avisynth 2.5x PlugIns Folder and use the command as explained above.

BUT! As I said ... I tested it yesterday and it worked well on differend colorspace sources, so if there will be a problem just scream.

function addblack (clip c, int "lof") {
lof= default(lof, 50)
ty= (IsRGB24(c)==true) ? "RGB24" : (IsRGB32(c)==true) ? "RGB32" : (IsYUY2(c)==true) ? "YUY2" : "YV12"
ch= (AudioChannels(c)==2) ? true : false
ar = Audiorate(c) 
d=BlankClip( Pixel_Type=ty,audio_rate=ar, stereo=ch, length=lof, width=wi, height=hi, fps=fr, color=$000000)
Return d+c+d
If you dont want the Fade-in and fade-out to be applied, just delete the line "c=fadein(c,25).Fadeout(25)"
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! SD70161SXl, "Progressive Scan On" and Black duru! Players, DVRs, Media Centers 4 10-05-2004 08:02 PM
""""""Por favor me ajude" ficoboy Conversão e Codificação de Vídeo (Português) 49 08-24-2004 05:35 PM
"""Legenda no virtualdub""" ficoboy Conversão e Codificação de Vídeo (Português) 6 08-06-2004 01:30 PM
Quais os codec's? """"""" ficoboy Conversão e Codificação de Vídeo (Português) 1 05-11-2004 10:14 AM
CQ con Tok "automatico" o CQ_VBR "manual" r1racing1 Convertir y Codificar Video (Español) 4 11-27-2003 05:14 PM

Thread Tools

All times are GMT -5. The time now is 12:14 PM  —  vBulletin © Jelsoft Enterprises Ltd