2008-05-02, 09:28 | Link #121 |
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 Last edited by pichu; 2008-05-02 at 10:05. |
2008-05-02, 10:07 | Link #122 |
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.
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
__________________
|
2008-05-04, 02:08 | Link #124 |
Excessively jovial fellow
Join Date: Dec 2005
Location: ISDB-T
Age: 37
|
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.
__________________
Last edited by TheFluff; 2008-05-04 at 02:48. |
2008-05-04, 03:02 | Link #125 | |
Senior Member
Fansubber
Join Date: Jul 2004
|
Quote:
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? |
|
2008-05-05, 11:22 | Link #127 |
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. |
2008-05-05, 12:36 | Link #128 | |
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 } 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:
|
|
2008-05-05, 13:30 | Link #129 |
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. Last edited by pichu; 2008-05-05 at 13:46. |
2008-05-05, 14:20 | Link #130 |
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. |
2008-05-05, 14:54 | Link #131 |
Senior Member
Fansubber
Join Date: Jul 2004
|
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.
|
2008-05-09, 05:41 | Link #134 |
Aegisub dev
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 39
|
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.
__________________
|
2008-05-10, 08:04 | Link #138 |
Senior Member
Join Date: Mar 2004
|
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. |
2008-05-10, 12:20 | Link #139 |
Excessively jovial fellow
Join Date: Dec 2005
Location: ISDB-T
Age: 37
|
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.
__________________
|
2008-05-10, 15:18 | Link #140 | |
x264 Developer
Join Date: Feb 2008
|
Quote:
|
|
Thread Tools | |
|
|