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 2008-05-02, 09:28   Link #121
pichu
Senior Member
*Fansubber
 
 
Join Date: Jul 2004
I don't think I should answer that question, and I'm pretty sure the answer would have been clear when you visit the link. I don't judge other people's work... But do tell me, what's wrong with MY script?

The reason I made those scripts is that I do not want to type out so much avisynth codes when overlaying my signs, and that I want a way to overlay a lot of signs in one overlay by having them spliced continuously in one video (which is why I deal with global variables--since avisynth doesn't support object-oriented scripting)... This is really only for me, but then I've decided to share it with fellow typesetters.

The script will cause memory faults in AVISynth 2.55 and under, which is why I suggest to use 2.56 and above. heh It also might take long to parse due to the conditions, but once it's finished parsing, everything will run normally.

PS:

His -
title = imagesource( "C:\Documents and Settings\Greg\My Documents\VirtualDub\grev-logo\beyblade-logo%04d.png", start = 0001, end = 0123, use_devil=true, pixel_type="rgb32").assumefps(last)
insertsign(last, title, 153, 276)

Mine -
imgsign("C:\Documents and Settings\Greg\My Documents\VirtualDub\grev-logo\beyblade-logo%04d.png").sign(153,276)

---

Sorry, another shameless promotion of my work
__________________
A small tool I made, and Learn how to make fansub karaoke in After-Effects: AFXKRK

Last edited by pichu; 2008-05-02 at 10:05.
pichu is offline   Reply With Quote
Old 2008-05-02, 10:07   Link #122
martino
makes no files now
 
 
Join Date: May 2006
I can see most (or least the most obvious ones) differences myself, it was mostly aimed to help others who may not know from looking at the code/etc... but fine. Either way, you've given a simple explanation which should suffice to most I guess.

Quote:
Originally Posted by pichus View Post
But do tell me, what's wrong with MY script?
Nothing by just looking at it, apart from the fact that it looks somewhat complicated -- mainly when compared to the other one. Comes down to personal preference (laziness? ) which one you want to use I suppose.

P.S. You don't need the .assumefps(last) for overlaying IIRC
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2008-05-04, 00:28   Link #123
dragon5152
Junior Member
*Fansubber
 
Join Date: Aug 2007
Send a message via AIM to dragon5152 Send a message via MSN to dragon5152 Send a message via Yahoo to dragon5152
Quote:
Originally Posted by martino View Post
P.S. You don't need the .assumefps(last) for overlaying IIRC
If the overlay is 23.976 and the source is 29.97 which occurs on VFR sources a lot, it might be needed
dragon5152 is offline   Reply With Quote
Old 2008-05-04, 02:08   Link #124
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
Wrong, overlay() doesn't care about timestamps and hence not about framerates, it just pairs up frames from the input clip with frames from the overlay.

Also jesus christ pichus that is a hilariously overcomplicated way to overlay signs.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read

Last edited by TheFluff; 2008-05-04 at 02:48.
TheFluff is offline   Reply With Quote
Old 2008-05-04, 03:02   Link #125
pichu
Senior Member
*Fansubber
 
 
Join Date: Jul 2004
Quote:
Originally Posted by TheFluff View Post
Also jesus christ pichus that is a hilariously overcomplicated way to overlay signs.
Define: "Complicated"

It can be as simple as:

avisource( "op.avi" )
avisign( "afx_karaoke.avi" ).sign
avisign( "credits.avi" ).sign( 100 )
imgsign( "logo.png" ).sign( 500 , 700 )

then an afx karaoke with credits and logo starting later is overlayed correctly on top of an opening sequence. How much simpler you can get?
__________________
A small tool I made, and Learn how to make fansub karaoke in After-Effects: AFXKRK
pichu is offline   Reply With Quote
Old 2008-05-05, 00:40   Link #126
fireshark
CRF Believer
*Fansubber
 
 
Join Date: Jan 2007
Send a message via AIM to fireshark
I think he means your code
fireshark is offline   Reply With Quote
Old 2008-05-05, 11:22   Link #127
pichu
Senior Member
*Fansubber
 
 
Join Date: Jul 2004
Well, instead of being so egotistical over this, why not spend the time to put my link on the first post in the FAQ?

http://pichu.org/overlays

And, I am opened to suggestions anyways. And, trust me... This is one of the simplest scripts I wrote.
__________________
A small tool I made, and Learn how to make fansub karaoke in After-Effects: AFXKRK
pichu is offline   Reply With Quote
Old 2008-05-05, 12:36   Link #128
dj_tjerk
Ana-chan~
 
 
Join Date: May 2006
Location: Netherlands
Code:
function insertsign(clip mainclip, string filename, int startframe, int "endframe") {
	overlayclip = avisource(filename)
	endframe = default(endframe,startframe+overlayclip.framecount-1)

	begin	= (startframe == 1) ? mainclip.trim(0,-1) : mainclip.trim(0,startframe-1)
	middle	= mainclip.trim(startframe,endframe)
	end	= mainclip.trim(endframe+1,0) 
	
	middleoverlay = Overlay(middle, overlayclip, mask=overlayclip.showalpha())
	
	begin = (startframe == 0) ? BlankClip(mainclip, length=0) : begin
	end = (endframe == mainclip.framecount-1) ? BlankClip(mainclip, length=0) : end 
	
	return begin ++ middleoverlay ++ end
}
Usage: insertsign("blabla.avi", 400)

One extra line and fluff's script basically does the same. Making one big clip of signs hasnt proven useful for me, as I often need to upload v2's of specific signs (not that matters much.. it's more work for the encoder to remove and add some lines though with one big clip).. and I don't like working in one big composition. I also never use still images, i always make clips in AE, even if the scene is static.. Also, I don't like dragging and dropping, I prefer some weird .jar that i double click on and it generates the .avs script, and maybe even 7z's all the files.

In the end.. who cares.. pichu's script works, fluff's script works, and if I may believe avisynth's mediawiki:

Quote:
Input for overlay is any colorspace, and colorspaces of different clip doesn't matter! The input clips are internally converted to a general YUV (with no chroma subsampling) format, so it is possible for the filter to output another colorspace than the input. It is also possible to input video in different colorspaces, as they will be converted seamlessly. It is however not recommended to use overlay only for colorspace conversions, as it is both slower and with slightly worse quality.
the colorspace of your overlay clip doesnt even matter..
dj_tjerk is offline   Reply With Quote
Old 2008-05-05, 13:30   Link #129
pichu
Senior Member
*Fansubber
 
 
Join Date: Jul 2004
colorspace only matters when you have to deal with video splices... But, thanks for reminding me this... I just removed colorspace and automatically set colorspaces for the video clips splices over here.

(and the only part I haven't bother checking is the audio portion of the video clips splices, so one will have to convert them manually -- but it's an easy task to convert though in my avisign function... I just never encountered problems with it though)

To splice in a video or part of the video clip in replacement of the video portion -- very much like overlay without the Alpha channel - only faster.

avisign( "sign.avi" ).sign( 100 , mode="splice" )

Sometimes you need to use splices because how AFX transfer blending modes work differently from AVISynth, so overlay will not always work.

Also, you can use v1b codec if you want to with a separate RGB and Alpha channel, defined... or jpg with a separate grayscale mask file.
__________________
A small tool I made, and Learn how to make fansub karaoke in After-Effects: AFXKRK

Last edited by pichu; 2008-05-05 at 13:46.
pichu is offline   Reply With Quote
Old 2008-05-05, 14:20   Link #130
dj_tjerk
Ana-chan~
 
 
Join Date: May 2006
Location: Netherlands
In the days when i didnt have much space, i even encoded a separate xvid alpha video lol xD (and the rgb also in xvid). Anyway, I don't see what splices have to do with blending modes in avisynth? I thought it was just your way of making one big clip.

Last edited by dj_tjerk; 2008-05-05 at 15:24.
dj_tjerk is offline   Reply With Quote
Old 2008-05-05, 14:54   Link #131
pichu
Senior Member
*Fansubber
 
 
Join Date: Jul 2004
Quote:
Originally Posted by dj_tjerk View Post
In the days when i didnt have much space, i even encoded a separate xvid alpha video lol xD (and the rgb also in xvid). Anyway, I don't see what splices have to do with blending modes in avisynth? I thought it was just your way of making one big clip.
no it doesn't... but i just set that as a condition... I can even put an option like "Add" so that it adds to the clip (addclip, addbefore, addafter)... but i don't think it's needed for any of the work i did. If i want to do this, I'd just trim/avisource manually.
__________________
A small tool I made, and Learn how to make fansub karaoke in After-Effects: AFXKRK
pichu is offline   Reply With Quote
Old 2008-05-07, 22:18   Link #132
comatose
Senior Member
 
 
Join Date: Dec 2007
I think what pichu means is that sometimes AFX doesn't create clips that Avisynth can properly overlay with transparency, so a complete AFX render is required.

Then, you have to use splice. e.g. trim(before)+afx+trim(after)
comatose is offline   Reply With Quote
Old 2008-05-09, 05:05   Link #133
mad_cracker
AFX ADDiCT
*Fansubber
 
 
Join Date: Jul 2006
Location: Portugal
Hi minna. I was wondering if there is a way to overlay videos without re-encoding. I mean, like a video layer that we can switch off and on whenever we want. Just like DVD subs.
Thanks
__________________

::AFX ADDiCT::.
mad_cracker is offline   Reply With Quote
Old 2008-05-09, 05:41   Link #134
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 29
Nope, there isn't.
Actually I think DirectShow (using Video Media Renderer 9, possibly also 7) allows to build graphs that can do something like that, but there isn't any user friendly way to achieve it.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2008-05-10, 03:49   Link #135
Dark Shikari
x264 Developer
 
 
Join Date: Feb 2008
Quote:
Originally Posted by mad_cracker View Post
Hi minna. I was wondering if there is a way to overlay videos without re-encoding. I mean, like a video layer that we can switch off and on whenever we want. Just like DVD subs.
Thanks
Avisynth will do the trick.
Dark Shikari is offline   Reply With Quote
Old 2008-05-10, 06:45   Link #136
mad_cracker
AFX ADDiCT
*Fansubber
 
 
Join Date: Jul 2006
Location: Portugal
Can you please suggest some tutorial for that?
Thanks jfs and thanks Dark Shikari.
__________________

::AFX ADDiCT::.
mad_cracker is offline   Reply With Quote
Old 2008-05-10, 07:49   Link #137
martino
makes no files now
 
 
Join Date: May 2006
Overlay()...
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2008-05-10, 08:04   Link #138
jpwong
Senior Member
 
 
Join Date: Mar 2004
Quote:
Originally Posted by martino View Post
Overlay()...
I don't think that's quite what they want, they're describing something that works like subtitles do in a DVD. That is, from the player, you can say, show the extra video layer on screen, or turn it off at any given time, so say the end user could watch the whole thing with that video layer on, then go back and re-watch it with it off.

If that is what in fact they want, I don't think it's something you can do in avisynth.
jpwong is offline   Reply With Quote
Old 2008-05-10, 12:20   Link #139
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
If you feel like being very annoying, I'm pretty sure it can actually be done (with Avisynth, no less).

The process would be something like this:
1) encode a multi-segment MKV file where the first segment contains what you want to overlay and the second segment contains the actual video to overlay on.
2) mux it with ordered editions so anyone with a proper splitter will only see the second segment.
3) tick the "Avisynth" box in ffdshow, input code to load the mkv file you're playing with ffmpegsource (will read the first segment) and do the appropriate overlay()'ing on what's currently actually being played.
4) untick the avisynth box to disable overlaying.




(ps: don't actually try this at home, kids)




edit: obviously, if you don't mind distributing multiple files you can of course provide the overlay as a separate file together with an Avisynth script that does the overlaying; you can play that in a video player directly to get the overlayed version, and the ordinary video file to get the non-overlayed version.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2008-05-10, 15:18   Link #140
Dark Shikari
x264 Developer
 
 
Join Date: Feb 2008
Quote:
Originally Posted by jpwong View Post
I don't think that's quite what they want, they're describing something that works like subtitles do in a DVD. That is, from the player, you can say, show the extra video layer on screen, or turn it off at any given time, so say the end user could watch the whole thing with that video layer on, then go back and re-watch it with it off.

If that is what in fact they want, I don't think it's something you can do in avisynth.
If they just need it for personal use, its really easy to do with a simple Avisynth script. Comment out the overlay line to disable the overlay.
Dark Shikari 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 11:13.


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