AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > Anime Related Topics > Fansub Groups

Notices

Reply
 
Thread Tools
Old 2012-01-23, 02:46   Link #561
TheRyuu
warpsharpened
 
Join Date: Sep 2008
Create your overlay.

Then using:
Code:
###  Overlay functions for RGBA videos and images with optional mattes
##
## Written by pichu, v0.4a
## Requires AVISynth 2.56+
## Put this into your avisynth plugins directory
## Preliminary: aviSign( clip c string "filename" [, bool "rescale" = false , string "alpha_file" , string "colorspace" ] ) - this will open the overlay video for all sign( ) and reset the frame number, until another aviSign( ) is declared.
## Preliminary: imgSign( clip c string "filename" [, bool "rescale"  = false , string "alpha_file" , "colorspace" ] ) - this will open the overlay image for all sign( ) and reset the frame number, until another aviSign( ) is declared.
##       Usage: sign( clip c , int "start_frame" = 0 , int "end_frame" = 0 ,  , int "offset" = 0 , string "mode" = "Blend" , int "x" = 0 , int "y" = 0 )
#   Parameters:            c           is the current clip getting overlayed (required)
#                          filename    is the filename of the RGBA overlay avi. (required)
#                          start_frame is the starting frame of the overlay. (default = 0)
#                          end_frame   is the ending frame of the overlay. (default = 0)
#                          offset      is the number of frames to offset from current. (default = 0)
#                          mode        is the blending mode of the current overlay segment. (default = "blend")
#                                Note:    When mode="splice", the current clip will be spliced instead of overlayed.
#                          x, y        are the coordinates offset (default = 0,0)
#                          colorspace  is the colorspace conversion.  It can be: RGB, RGB24, RGB32, YUY2, or YV12.

#   Conditions:   If start_frame = 0, it will compute using the number of frames in the overlay to the end_frame. 
#                 If end_frame = 0,   it will compute using the number of frames in the overlay to the start_frame. 
#                 If start_frame and end_frame are both 0, then the beginning of the video will get overlayed.
#                     Note: this code can't allow you to overlay the clip on frame 0 with only one frame.
# Examples:
#
# import( "Signs_Overlay.avsi" )
# sign( 1111 , 2222 ) +\
# sign( 4444 , 5555 )
# 
# The above example will generate the entire video sequence for clips at those frames. (synonymous to trim)
# Now, you just need to add in aviSign( ... ) and remove +\ to get the final overlays :)
#
# import( "Signs_Overlay.avsi" )
# aviSign( "Sign1.avi" ).sign( 1234 )   # Allow you to overlay Sign1.avi at frame #1234 and ends at wherever the overlay ends.
# aviSign( "Sign_all.avi" )
# sign( 1111 , 2222 )
# sign( 4444 , 5555 ) # The next sign, starting at frame 4444 and end at frame 5555 will get overlayed



global SIGN_OVERLAY = ""
global SIGN_FRAME = 0

function sign( clip c , int "start_frame" , int "end_frame" , int "offset" , string "mode" , int "x" , int "y" )
{
	offset = Default( offset , 0 )
	mode = Default( mode , "Blend" )
	end_frame = Default( end_frame , 0 )
	x = Default( x , 0 )
	y = Default( y , 0 )
	start_frame = Default( start_frame , 0 )
	overlay_frame = SIGN_FRAME
	assert( defined( c ) , "You must have a working video clip to be overlayed" )
	end_frame = SIGN_OVERLAY.isclip ? ( ( end_frame > 0 ) ? end_frame : start_frame + SIGN_OVERLAY.framecount - 1 - SIGN_FRAME ) : end_frame
	start_frame = SIGN_OVERLAY.isclip ? ( ( start_frame >= 0 ) ? start_frame : end_frame - SIGN_OVERLAY.framecount + 1 + SIGN_FRAME ) : start_frame
	assert( start_frame < end_frame , "Starting Frame (" + string( start_frame ) + ") must be smaller than Ending Frame (" + string( end_frame ) + ")!" )
	assert( ( start_frame >= 0 ) && ( end_frame >= 0 ) , "Starting (" + string( start_frame ) + ") and Ending Frame (" + string( end_frame ) + ") must not be smaller than 0" )
	assert( end_frame < c.framecount , "The number of frames being overlayed must not be bigger than the number of frames in the clip you're overlaying on (end frame = " + String( end_frame ) + ")" )
	o = SIGN_OVERLAY.isclip() ? SIGN_OVERLAY.assumefps( c ).trim( overlay_frame + offset , overlay_frame + end_frame - start_frame ) : ""
	global SIGN_FRAME = SIGN_FRAME + end_frame - start_frame + 1
	start_frame = start_frame + offset
	sign_overlays = lcase( mode ) == "splice" ? o : ( SIGN_OVERLAY.isclip() ? c.trim( start_frame , end_frame ).overlay( o , x , y , o.showalpha , mode=mode ) : "" )
	return \
		SIGN_OVERLAY.isclip() ? \
		   ( start_frame > 0 ? \
			( end_frame < c.framecount( ) - 1 ? \
			c.trim( 0 , -start_frame ) ++ sign_overlays ++ c.trim( end_frame + 1 , 0 ) : \
			c.trim( 0 , -start_frame ) ++ sign_overlays ) : \
			( end_frame < c.framecount( ) - 1 ? \
			sign_overlays ++ c.trim( end_frame + 1 , 0 ) : \
			sign_overlays ) \
		   ) : c.trim( start_frame , end_frame )
}

function aviSign( clip c , string "filename" , bool "rescale" , string "alpha_file" , string "colorspace" )
{
	rescale = Default( rescale , false )
	colorspace = Default( colorspace , "" )
	colorspace = UCase( colorspace )
	alpha_file = Default( alpha_file , "" )
	v = avisource( filename ).converttorgb32
	global SIGN_FRAME = 0
	global SIGN_OVERLAY = rescale ? ( ( alpha_file != "" ) ? mergeargb( avisource( alpha_file ) , v.showred , v.showgreen , v.showblue ) : v ).assumefps( c ).lanczos4resize( c.width , c.height ) : ( ( alpha_file != "" ) ? mergeargb( avisource( alpha_file ) , v.showred , v.showgreen , v.showblue ) : v ).assumefps( c )
	global SIGN_OVERLAY = colorspace == "YV12" ? SIGN_OVERLAY.converttoyv12( ) : ( colorspace == "YUY2" ? SIGN_OVERLAY.converttoyuy2( ) : ( colorspace == "RGB" ? SIGN_OVERLAY.converttorgb( ) : ( colorspace == "RGB24" ? SIGN_OVERLAY.converttorgb24( ) : ( colorspace == "RGB32" ? SIGN_OVERLAY.converttorgb32( ) : SIGN_OVERLAY ) ) ) ) 
	return c 
}

function imgSign( clip c , string "filename" , bool "rescale" , string "alpha_file" , string "colorspace" )
{
	rescale = Default( rescale , false )
	colorspace = Default( colorspace , "" )
	colorspace = UCase( colorspace )
	alpha_file = Default( alpha_file , "" )
	v = imagesource( file=filename , start=0 , end=c.framecount - 1 , use_devil = true , pixel_type="RGB32" ).converttorgb32
	global SIGN_FRAME = 0
	global SIGN_OVERLAY = rescale ? ( ( alpha_file != "" ) ? mergeargb( imagesource( file=alpha_file , start=0 , end=c.framecount - 1 , use_devil = true ) , v.showred , v.showgreen , v.showblue ) : v ).lanczos4resize( c.width , c.height ) : ( ( alpha_file != "" ) ? mergeargb( imagesource( file=alpha_file , start=0 , end=c.framecount - 1 , use_devil = true ) , v.showred , v.showgreen , v.showblue ) : v )
	global SIGN_OVERLAY = colorspace == "YV12" ? SIGN_OVERLAY.converttoyv12( ) : ( colorspace == "YUY2" ? SIGN_OVERLAY.converttoyuy2( ) : ( colorspace == "RGB" ? SIGN_OVERLAY.converttorgb( ) : ( colorspace == "RGB24" ? SIGN_OVERLAY.converttorgb24( ) : ( colorspace == "RGB32" ? SIGN_OVERLAY.converttorgb32( ) : SIGN_OVERLAY ) ) ) ) 
	return c 
}
Overlay your karafx on the video like this:
Code:
Import(X:\path\to\Signs_Overlay.avs") #the above script

AVISource("X:\path\to\source.avi")
avisign("X:\path\to\overlay.avi").sign(startframe,endframe) #endframe optional
TheRyuu is offline   Reply With Quote
Old 2012-01-23, 06:30   Link #562
gilcohen
Member
 
Join Date: Sep 2010
Emm I don't know if ask here or in other place.

In Aegisub the line start in 0:22:30.05 after I encode the episode the line start in 0:22:30.10. (I put the encoded episode in Aegisub and match the times, before and after)
end in 0:22:31.98 after the encode 0:22:32.019.

looks like in the lines of all the ep is OK but in the name of the episode and of the next episode it's happening.

Thanks!
__________________
Beelzebub forever! XD
gilcohen is offline   Reply With Quote
Old 2012-01-26, 23:48   Link #563
TheRyuu
warpsharpened
 
Join Date: Sep 2008
(from visitors messages or something)
Quote:
Originally Posted by jnazh
When I used this orders, background of overlayFX video is black -_- ?

Code:
Import("D:\anime\Signs_Overlay.avs")
AVISource("D:\anime\Persona4 ED WR.avi")
avisign("D:\anime\OverlayFX.avi").sign(1,1720)


I used this orders when I make overlay video for ass karaoke FX
Code:
v =AviSource("D:\anime\Persona4 ED WR.avi")
MaskSub("D:\anime\persona 4 ED2 [Kanji Ktimed].ass" v.width,v.height,v.framerate,v.framecount).FlipVer tical()
thnx for help . ^^
You didn't save your overlay as RGBA.

When you make your overlay I'd use lagarith (lags), fast recompress, set to output RGBA (null frames and multithreading should probably be checked on too).
TheRyuu is offline   Reply With Quote
Old 2012-01-29, 08:09   Link #564
jnazh
Junior Member
 
 
Join Date: Dec 2008
Location: US
Age: 23
Send a message via MSN to jnazh
I don't use AFX to save overlay as RGBA
__________________
jnazh is offline   Reply With Quote
Old 2012-01-30, 13:12   Link #565
TheRyuu
warpsharpened
 
Join Date: Sep 2008
Quote:
Originally Posted by jnazh View Post
I don't use AFX to save overlay as RGBA
Code:
v =AviSource("D:\anime\Persona4 ED WR.avi")
MaskSub("D:\anime\persona 4 ED2 [Kanji Ktimed].ass" v.width,v.height,v.framerate,v.framecount).FlipVer tical()
Well obviously but I'm saying in vdub you have to save it as RGBA. I'm not sure you're understanding how it all works.
TheRyuu is offline   Reply With Quote
Old 2012-02-01, 11:53   Link #566
jnazh
Junior Member
 
 
Join Date: Dec 2008
Location: US
Age: 23
Send a message via MSN to jnazh
Quote:
Originally Posted by TheRyuu View Post
Code:
v =AviSource("D:\anime\Persona4 ED WR.avi")
MaskSub("D:\anime\persona 4 ED2 [Kanji Ktimed].ass" v.width,v.height,v.framerate,v.framecount).FlipVer tical()
Well obviously but I'm saying in vdub you have to save it as RGBA. I'm not sure you're understanding how it all works.
you mean I have to use Lagarith lossless Code, right ?
__________________
jnazh is offline   Reply With Quote
Old 2012-02-01, 14:21   Link #567
TheRyuu
warpsharpened
 
Join Date: Sep 2008
Quote:
Originally Posted by jnazh View Post
you mean I have to use Lagarith lossless Code, right ?
Any codec with RGBA, lags is simply most suited to overlays because of a lot of the frame being blank. utvideo would be much larger (but would still work fine if you chose RGBA).
TheRyuu is offline   Reply With Quote
Old 2012-02-02, 10:52   Link #568
jnazh
Junior Member
 
 
Join Date: Dec 2008
Location: US
Age: 23
Send a message via MSN to jnazh
Quote:
Originally Posted by TheRyuu View Post
Any codec with RGBA, lags is simply most suited to overlays because of a lot of the frame being blank. utvideo would be much larger (but would still work fine if you chose RGBA).

The problem still exists

even when if I encoder with RABA, overlay video with black background





anyway thanx for reply and ur help




.
__________________
jnazh is offline   Reply With Quote
Old 2012-02-03, 00:03   Link #569
TheRyuu
warpsharpened
 
Join Date: Sep 2008
Quote:
Originally Posted by jnazh View Post
The problem still exists
What are you using to make the file?
TheRyuu is offline   Reply With Quote
Old 2012-02-03, 07:48   Link #570
jnazh
Junior Member
 
 
Join Date: Dec 2008
Location: US
Age: 23
Send a message via MSN to jnazh
First I encoder overlay video, I used Lagarith lossless Code to save overlay as RGBA
Quote:
v =AviSource("D:\anime\Persona4 ED WR.avi")
MaskSub("D:\anime\persona 4 ED2 [Kanji Ktimed].ass" v.width,v.height,v.framerate,v.framecount).FlipVer tical()
after that I used this :

Quote:
import("D:\anime\Signs_Overlay.avs")
AviSource("D:\anime\Persona4 13 ED.avi")
avisign("D:\anime\Overlay.avi").sign(1,1720)
but black background still exist
__________________
jnazh is offline   Reply With Quote
Old 2012-02-06, 10:29   Link #571
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
Did you set it to Wumbo?...
DreGon45 is offline   Reply With Quote
Old 2012-02-06, 15:10   Link #572
TheRyuu
warpsharpened
 
Join Date: Sep 2008
Quote:
Originally Posted by jnazh View Post
but black background still exist
The only thing I can think of right now is that you're using vdubmod (which you shouldn't be) which has a bug where even if you select fast recompress it would convert to yuy2 for some random reason.
TheRyuu is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 19:50.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
We use Silk.