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 9th November 2006, 16:31   #1  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
request a filter

I took a look at the C api for avisynth, I think it's simple enough that I could write something. Anyone have any need for a filter that they just can't find anywhere?
Conversely, I hope some experienced coders will help me over the learning curve.
thanks.
jmac698 is offline   Reply With Quote
Old 9th November 2006, 16:41   #2  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Actually, I do. YGPM .
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 9th November 2006, 22:33   #3  |  Link
Prettz
easily bamboozled user
 
Prettz's Avatar
 
Join Date: Sep 2002
Location: Atlanta
Posts: 373
Heheh, how about a spatial denoiser using the Sigma Filter? I had to implement that as a project for my Digitial Image Processing class, and I've been wondering whether it would be useful for video filtering. I would sit down and learn how to write an avisynth filter to do it myself, but I don't have any free time.
Prettz is offline   Reply With Quote
Old 10th November 2006, 01:53   #4  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
I don't think sigma filter is the best. Before choosing a denoiser, I would survey existing filters to see what has been done already, then choose a better one from research papers, then implement.
http://www.fmrib.ox.ac.uk/~steve/sus...00000000000000
I don't agree that this "SUSAN" is always the best, it performs some extra contrast enhancement as a tradeoff.
jmac698 is offline   Reply With Quote
Old 10th November 2006, 05:49   #5  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Why C_API? Regular AviSynth plugins API is more common and stable
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 10th November 2006, 15:22   #6  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
But then I have to do C++, unless you want to tutor me..
jmac698 is offline   Reply With Quote
Old 10th November 2006, 15:29   #7  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
@jmac698: You don't have to worry about C++, when you do a "regular" filter - it's all taken care of behind the scenes. You can just write regular C inside the GetFrame() function.

(You do know that C is a subset of C++, right?)
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 11th November 2006, 03:21   #8  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
ok, and can you think of a simple example that does not use mmx,sseX? With pure C in getframe?
I know it's a subset but I didn't know how freely you could mix the code.
jmac698 is offline   Reply With Quote
Old 11th November 2006, 07:50   #9  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Did you see SimpleSample and FilterSDK ?
(sticky thread).
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote
Old 11th November 2006, 09:54   #10  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
If you're still thinking of ideas, I'd like to see an upsizing filter that uses a supersampling or super resolution algo.

http://www.wisdom.weizmann.ac.il/~vi...Res_demos.html
http://citeseer.ist.psu.edu/context/845587/0
http://graphics.stanford.edu/courses...amp/samp3.html


Another thing that might be cool is an AVCsource or H264source filter, in the vein of DGdecode.dll or RawSource.Dll. There's always DirectShowSource, but with the advent of HDAVC (or is it AVC-HD?), channels like BBC HD, and the new HD formats on disk, maybe something more focused specifically on h264 could be beneficial. There's the QTinput.dll that has support for h264 Quicktime, but Quicktime only.


Thank you for your consideration.

Last edited by Pookie; 11th November 2006 at 10:52.
Pookie is offline   Reply With Quote
Old 11th November 2006, 11:24   #11  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Your last link looks like little more than an audio oversampling D/A applied to 2D images (no provision for 3D video, as in the first, which is much more interesting). Video is problematic for that because it's of such a low resolution (dimensions and bit depth) that they tend to drown in aliasing - except for the introduction of some random jitter, this is how multi-tap resizers work, after all.

I'm still off and on playing in the area with EEDI2, but I'm still waiting for tritical's upcoming breakthrough arbitrary resize version.

MP4Source (since mp4 has a fairly limited number of codecs), or some kind of MplayerSource/FFmpegSource would be hot. Plus ffmpeg is all C.

As for the language, since avisynth gives you a pointer to a malloc'd frame buffer, once you have that you can do anything you want with it, with any C/C++/asm syntax, or whatever else you can convince visual studio into compiling. The rest of the boilerplate, like argument checking in the constructor, can be copied out of other plugins. Unfortunately, you must use visual studio in 2.x, the one downside.
foxyshadis is offline   Reply With Quote
Old 11th November 2006, 11:38   #12  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
Quote:
Originally Posted by foxyshadis View Post
Your last link looks like little more than an audio oversampling D/A applied to 2D images (no provision for 3D video, as in the first, which is much more interesting). Video is problematic for that because it's of such a low resolution (dimensions and bit depth) that they tend to drown in aliasing - except for the introduction of some random jitter, this is how multi-tap resizers work, after all.
Agreed. I wasn't sure if I was asking for something too complicated or unrealistic in link 1, hence link 3.
Pookie is offline   Reply With Quote
Old 11th November 2006, 23:58   #13  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
got simplesample thanks..
jmac698 is offline   Reply With Quote
Old 14th November 2006, 17:58   #14  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Did you read my PM? If so, how feasible do you think it is?
__________________
Read Decomb's readmes and tutorials, the IVTC tutorial and the capture guide in order to learn about combing and how to deal with it.
Chainmax is offline   Reply With Quote
Old 14th November 2006, 23:06   #15  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
That is being followed elsewhere
http://forum.doom9.org/showthread.php?t=118264
jmac698 is offline   Reply With Quote
Old 19th November 2006, 16:24   #16  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
I'm looking for a filter to do RGB channel mixing, like Photoshop. It would take nine arguments (rr,rg,rb, gr,gg,gb, br,bg,bb) and would do this:

new_r=r*rr+g*rg+b*rb
new_g=r*gr+g*gg+b*gb
new_b=r*br+g*bg+b*bb

The only thing that comes close that I could find was RGBManipulate, but it crashes when I try to use RGBMerge. Is this something you'd like to try creating, jmac?

Alternatively, if anyone knows of an already existing filter to do what I'm after, please let me know.

David

Edited to add: sorry, it looks like I was wrong to use RGBManipulate as AviSynth has it's own versions of these functions since 2.5.6. I can now achieve the effect I was looking for this way, but a channel mixing plugin might still be nice

Last edited by wonkey_monkey; 19th November 2006 at 16:32.
wonkey_monkey is offline   Reply With Quote
Old 11th December 2006, 18:06   #17  |  Link
ceboluga
Noob
 
ceboluga's Avatar
 
Join Date: Dec 2006
Location: Brazil
Posts: 2
hue gradient

jmac698,

I've got a similar problem as seen on
http://forum.doom9.org/showthread.php?t=90627. My VHS tapes are too old. Somehow the colors got distorted on the original tapes like these:




I've tried TweakColor and gradient mask with no good results.

I've tried some features of PhotoShop. My conclusion is: somehow the days of existence of the tapes applied them a hue distortion from left to right. Most of my tapes need a gradual hue correction from +40° in the left to 0° in the center to -40° in the right side.

The filter that seewen and I need must have 4 inputs: lefthue, left%, righthue, right%, where:

left% = the percentage of the screen (left side) that the filter will be applied
right% = as above, but for the right side
left hue = is value to increase/ decrease of the left-most pixel's hue.
right hue = same as above, for the right side.

The effect follows the diagram below:



Thank you.
__________________
Ceboluga
CPI & MBM Breadcasting
ceboluga is offline   Reply With Quote
Old 11th December 2006, 19:47   #18  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
You can try to do that with two masks and mt_merge.

Create one mask for the left hue, white on the left, progressively goin to block black as soon as the left hue is 0. Create another mask for the right hue ( white on the right, black when the right hue is 0 ), then use the following script ( which works in YV12 ) :

Code:
lefthued = source.tweak(hue=left_hue)
righthued = source.tweak(hue=right_hue)

source_lefthued = mt_merge(source, lefthued, leftmask, luma=true, u=3, v=3)
result = mt_merge(source_lefthued, righthued, rightmask, luma=true, u=3, v=3)
__________________
Manao is offline   Reply With Quote
Old 11th December 2006, 23:47   #19  |  Link
ceboluga
Noob
 
ceboluga's Avatar
 
Join Date: Dec 2006
Location: Brazil
Posts: 2
Very good, Manao!! It worked wonderfully! Here are the results:




And the final code:

Quote:
agape = ConverttoYV12 (AVISource("d:\teste.avi"))

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgbob.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mipsmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\guavacomb.dll")

lefthued = Tweak(agape,30)
righthued = Tweak(agape,-50)

leftmask = ImageReader ("d:\maskleft.bmp",0,0)
leftmask = Loop(leftmask,Framecount(agape))
leftmask = ConverttoYV12 (leftmask)

rightmask = ImageReader ("d:\maskright.bmp",0,0)
rightmask = Loop(rightmask,Framecount(agape))
rightmask = ConverttoYV12 (rightmask)

source_lefthued = mt_merge(agape, lefthued, leftmask, luma=true, u=3, v=3)
mt_merge(source_lefthued, righthued, rightmask, luma=true, u=3, v=3)

ConvertToYUY2()
DGBob(order=1,mode=0)
GuavaComb(Mode="NTSC",MaxVariation=85,Recall=65,Activation=80)
MipSmooth(preset="VHS")
Thank you!! Now I can see no Hulks in my metal band!!
__________________
Ceboluga
CPI & MBM Breadcasting
ceboluga is offline   Reply With Quote
Old 15th December 2006, 00:01   #20  |  Link
Ignus2
Registered User
 
Join Date: Dec 2005
Posts: 250
Using the C++ API, your only option is to use a Microsoft compiler. While Express is free now, and also quite good, some people still tend to prefer other compilers for whatever reason (often practical ones). The C api makes it possible to use your favourite compiler to write avisynth filters.

I have written a couple of filters with the C API. I don't say it was easy to get the hang of it, but it sure was simple afterwards.
Ignus2 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 01:08.


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