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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th September 2014, 17:42   #1  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,114
How to write a filter which creates a clip from nothing?

Hi,

I'd like to write a plugin which doesn't take a video clip as input, but does create one and return it as output.

Is there a "right" way to do this? How should I declare the constructor, which normally looks something like this:

Code:
example::example(PClip _child,  IScriptEnvironment* env) :
	GenericVideoFilter(_child) {
, since there is no PClip _child?

Do I create my own VideoInfo structure to create the output clip?

Does anyone have an example of some code for a filter which does this?

Thanks,

David
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 18th September 2014, 17:50   #2  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,384
Isn't that just what source filters do?

Have a look at the source code for mpeg2source() for example. Or the source code for BlankClip() within Avisynth.
videoh is offline   Reply With Quote
Old 18th September 2014, 17:54   #3  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,114
Oh yeah, I suppose they do! I never connected them with what I'm trying to do - thanks!

ETA: Having said that, I've tried to wade my through the mpeg2source source, but it seems I just don't understand enough to make any sense of it. And I can't find the blankclip code in the Avisynth source...
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 18th September 2014 at 18:26.
wonkey_monkey is offline   Reply With Quote
Old 18th September 2014, 20:28   #4  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,375
Quote:
Originally Posted by davidhorman View Post
And I can't find the blankclip code in the Avisynth source...
Here: src/sources/source.cpp
(I've been searching the codebase a lot lately)
raffriff42 is offline   Reply With Quote
Old 18th September 2014, 20:46   #5  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,099
https://github.com/FFMS/ffms2/blob/m...ources.cpp#L27

Basically, put a VideoInfo in your filter class and init it in your filter constructor (it's called VI in the FFMS2 code I linked), then in your GetFrame() just call env->NewVideoFrame(VideoInfo) and put your stuff in there.

Last edited by TheFluff; 18th September 2014 at 20:52.
TheFluff is offline   Reply With Quote
Old 18th September 2014, 22:45   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,000
RandomSource:- http://forum.doom9.org/showthread.ph...t=randomsource
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 +1. The time now is 12:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.