Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Registered User
Join Date: Dec 2004
Location: London
Posts: 26
|
Advice on education
Hi,
Can anyone suggest what road in education I need to take in order for this forum to stop sounding like double-dutch? I did a very small amount of C, Assembler (on a 6502) and VB for my HND in Electronic Engineering but nothing extensive. Are there any courses that specialise in programming software for the video industry? Any discussion or friendly suggestions are welcome.Thanks |
|
|
|
|
|
#2 | Link |
|
budala
Join Date: Oct 2003
Location: U.S.
Posts: 545
|
While at the University ... i did none of this. It has nothing to do with my job either. But is sure is fun.
![]() Over the last year or so ... I've learned a buuunch ... 1 piece at a time. ------ My best resources ------- Web searches Reading avs source code writing filter code testing -------------------------------- What do you want to know? There are all kinds of gems through out this forum. |
|
|
|
|
|
#4 | Link |
|
Registered User
Join Date: Dec 2004
Location: London
Posts: 26
|
The problem is that I do not have any C++ coding experience. So where I start having difficulty is after the includes are declared. Seriously when I look at SimpleSample that's the only part that is clear
![]() This is why I think I need some formal education so I can speak the language before I start trying to 'write a book'. Maybe not, maybe there are a few online crash courses which will de-mystify things. Any suggestions? |
|
|
|
|
|
#5 | Link |
|
Guest
Join Date: Jan 2002
Posts: 21,868
|
Buy some books on C++ and study them in conjunction with the extensive source code that is available. In my own experience, my C functional programming background was a barrier to absorbing the object model. But one day an "Aha" occurred.
|
|
|
|
|
|
#6 | Link |
|
Registered User
Join Date: Oct 2001
Posts: 62
|
Slightly off-topic but now that you brought it up: I haven't programmed anything besides C yet but I'm interested in learning Java (and maybe C++). Problem is I can't really grasp the concept of object-orientated programming.
Any recommandation for sources that are specialized on "converting programmers' minds" from procedural to object-orientated? |
|
|
|
|
|
#7 | Link |
|
Registered User
Join Date: Feb 2004
Location: NTSC R1
Posts: 2,046
|
Try this: Java for C and C++ Programmers.
|
|
|
|
|
|
#8 | Link | |
|
budala
Join Date: Oct 2003
Location: U.S.
Posts: 545
|
Quote:
You can try doing vdub filters to get your feet wet. They require no c++. Just basic c. But if you want a gui dialog, you gotta mess with windows stuff. Personally I've found that reading the c++ books was more confusing to me than it should have been. Here's a quick tutorial ... --- trevlac's 3 comments on those silly c++ classes --- This is more for reading and understanding not for designing programs. ![]() 1) It's all just bytes in memory. 2) A class is a glorified structure (aka a defined layout in memory) 3) Class structures are mostly pointers to functions that let you access their data. (function pointers just say go here and treat it like code) I Added a bunch of comments to Simon's 1st simple sample. My intention was to help with all the avisynth setup bits ... not with how you process the pixels. i think Simon covers that in his other samples. http://trevlac.us/docs/SimpleSample.cpp If you can read the font Ben provided some nice info about all of this when he 1st made Avisynth.http://www.avisynth.org/BensAviSynthDocs ------------------------ Hope that helps. ![]() [edit] If it is not clear from the code ... the basic order of things for a plugin filter is ... 1) Avisynth calls AvisynthPluginInit2() of your dll because if found a LoadPlugin() in a script. 2) Inside of AvisynthPluginInit2() you 'register' your function by giving Avisynth the script name of your function and a pointer to call when it finds your function in a script. 3) When Avisynth encounters your function in a script, it calls your registered pointer. You return a pointer to your class structure. This class structure needs to be based on a standard filter or provide pointers to some functions that Avisynth may want to call. 4) One function Avisynth wants to call is GetFrame(). Which Avisynth expects your filter to have. When it calls this, it expects your filter to return a 'filtered' frame. Last edited by trevlac; 25th April 2005 at 04:02. |
|
|
|
|
|
|
#9 | Link |
|
Registered User
Join Date: Dec 2004
Location: London
Posts: 26
|
My story so far:
Started working through a C++ tutorial I found on the web. Everything seemed to be progressing until I came to this program which stopped me in my tracks: // integer increaser #include <iostream.h> void increase (void* data, int type) { switch (type) { case sizeof(char) : (*((char*)data))++; break; case sizeof(short): (*((short*)data))++; break; case sizeof(long) : (*((long*)data))++; break; } } int main () { char a = 5; short b = 9; long c = 12; increase (&a,sizeof(a)); increase (&b,sizeof(b)); increase (&c,sizeof(c)); cout << (int) a << ", " << b << ", " << c; return 0; } I don't understand what the colons are saying and there was no prior mention of their meaning. Then I checked back here and read Trevlac's post and his suggested reading. Now from what I can understand a great deal of the code in SimpleSample is standard and just has to be there, and to alter the output only the "//--- FINALLY !!!! --------" code needs altering. So I decided to compile SimpleSample (1.7) and look at what the un-altered code does. And now for even more embarrassment, I can't even get the filter to work! Apparently the syntax is SimpleSample(clip,[size]), so shouldn't this work: Loadplugin("c:\av\avisynth\myplugins\SimpleSampleDbg.dll") TheClip = AVISource("c:\someclip.avi") SimpleSample(TheClip, 10) I know I'm an idiot and probably on borrowed time in a forum such as this, but here's hoping. |
|
|
|
|
|
#10 | Link | ||
|
Guest
Join Date: Jan 2002
Posts: 21,868
|
Quote:
Quote:
![]() Look at later versions of the sample at www.avisynth.org/SimpleSample, where more functionality is added. This one (the first) is just a skeleton without any real processing. Last edited by Guest; 25th April 2005 at 17:07. |
||
|
|
|
|
|
#11 | Link |
|
Registered User
Join Date: Dec 2004
Location: London
Posts: 26
|
I compiled version 1.7 of Simplesample which supposedly draws a square in the middle of the video. I don't get any video out and AviSynth gives me this error:
Invalid arguments to function "SimpleSample" (c:\test.avs, Line 4) I not 100% sure I'm compiling properly. Compiling the dll gives me the file name simplesampleDbg. Is this the debugging version and does that matter? Thanks Neuron2 I understand the colons now, I was looking too hard for some hidden meaning. |
|
|
|
|
|
#12 | Link |
|
budala
Join Date: Oct 2003
Location: U.S.
Posts: 545
|
Maybe the code had a bug.
Why don't you try one of the ones here: http://www.avisynth.org/SimpleSample They only go up to 1.6 They also have comments like the ones I made. Maybe when it is said a few different ways ... it will be easier. |
|
|
|
|
|
#13 | Link |
|
Registered User
Join Date: Dec 2004
Location: London
Posts: 26
|
It appears the code did indeed have a bug
![]() 1.6 compiled and worked fine. I'm going to start faffing around with the code now to see how much I can break it. If I'm happy to just work in RGB32 can I safely delete all the other colour space code? I'll probably be asking some more questions very soon... |
|
|
|
|
|
#14 | Link | |
|
budala
Join Date: Oct 2003
Location: U.S.
Posts: 545
|
Quote:
--------------- To add an xtra check -------------- Look in sample 1.0b, for the following line Code:
if (vi.IsPlanar()) // is input planar?
env->ThrowError("SimpleSample: input to filter must be in YUY2 or RGB");
Code:
if (! (vi.IsRGB32()) ) // is input RGB32?
env->ThrowError("SimpleSample: input to filter must be RGB32");
env is a reference back to Avisynth. ThrowError is a function you can call to stop everything. dot notation vs arrow -- This is in both C and C++ and can be confusing. vi.IsRGB32() means vi is the starting point in memory for the vi structure (object). We know exactly where vi it is, so go call it's IsRGB32() function. For env->ThrowError(), env is a pointer to an env structure. Meaning goto the env pointer memory location ... find where the real env is ... go there .... go call it's function. Here is a quick link I found on C,C++,Java. It's looks to be short and concise. ![]() http://www.outbacksoftware.com/cpp/cpp.html |
|
|
|
|
|
|
#15 | Link |
|
Simply me
Join Date: Aug 2002
Location: Lancashire, England
Posts: 610
|
@daveoggy
Could you post the exact script that gave you the error with 1.7 please regards Simon
__________________
http://www.geocities.com/siwalters_uk/fnews.html |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|