Resource icon

Corner Pin 1.2

khaver

Member
khaver submitted a new resource:

Corner Pin - Transform the 4 corners of a source

A Lua script that adds a four corner pin transform effect filter. Adjust the four corners of a source to create various perspective effects.
View attachment 80702
Copy filter-cornerpin.lua and filter-cornerpin\filter-cornerpin.effect to your scripts folder

(Tested only on Windows 10)

Based on a corner pin shader by Charles Fettinger

Read more about this resource...
 

mjgallant

New Member
How hard (and how CPU intensive) would it be to add a parameter to control x-axis curvature? A quadratic bezier with just one user-controlled point could produce a nice curved screen effect.
 

Suslik V

Active Member
The "reload" of the script has strange behavior (log errors about get_width, get_height etc. while filter is in use). Is it only for me or everyone?
Edit:
Consider to add script_load(), for me it solves the reload of the script that is in use
Lua:
function script_load(settings)
    obs.obs_register_source(source_def)
end
 
Last edited:
Khaver, Success on a Mac! It works, but in preview it just has a solid color. The solid color with the internal mac cam has the ability to be transformed, but you can't see the source in preview. Pretty neat anyway! However, the other scripts like PZR show, "no properties available." Oh! Just tried a different source, "display capture" and you can see corner pin fully in preview and it works. Perhaps your build can be similar to the corner pin to see if that works? Thanks for all your efforts!
 
@Want To Learn can you try the https://obsproject.com/forum/resources/unfish-lens.1532/ filter too? It shares same logic to get the filter source size. It will be interesting for me to see if the mac cam source will be shown in the filter's preview on your system. Also, can you try to add the Crop/Pad filter (with any values) just before/above this filter to see if something will appear in the filter's preview?
Success Suslik V! It works! I can see it in preview and the main window. Minor point though. At installation when I choose it in scripts it says, "no properties available", but doesn't matter. Fun tool. Thanks!
 
@Want To Learn can you try the https://obsproject.com/forum/resources/unfish-lens.1532/ filter too? It shares same logic to get the filter source size. It will be interesting for me to see if the mac cam source will be shown in the filter's preview on your system. Also, can you try to add the Crop/Pad filter (with any values) just before/above this filter to see if something will appear in the filter's preview?
I can't seem to find the crop pad filter to install it. Unless it's just the "crop filter " that I already have.
 
Last edited:

Suslik V

Active Member
@Want To Learn
1) The "no properties available" message is normal here because the script itself is not configurable. The script simply adds new filter to the list of available filters. As long as you running script - there is new filter in the list that you can use. By removing the script - the filter disappears from the list of available filters (thus the effect becomes inaccessible). Nothing to configure in the script itself, thus you see "no properties available" message.in the Tools>Scripts. It is pretty normal for this kind of scripts.

2) About "Crop/Pad" filter. Yeah, here I mean build-in OBS filter. The idea was to check if any filter that modifies size of the source, when it placed before this filter, affects the rendering of the filter's preview. If build-in filter works OK then sure - there is something strange is going on.
 
@Want To Learn
1) The "no properties available" message is normal here because the script itself is not configurable. The script simply adds new filter to the list of available filters. As long as you running script - there is new filter in the list that you can use. By removing the script - the filter disappears from the list of available filters (thus the effect becomes inaccessible). Nothing to configure in the script itself, thus you see "no properties available" message.in the Tools>Scripts. It is pretty normal for this kind of scripts.

2) About "Crop/Pad" filter. Yeah, here I mean build-in OBS filter. The idea was to check if any filter that modifies size of the source, when it placed before this filter, affects the rendering of the filter's preview. If build-in filter works OK then sure - there is something strange is going on.
Nope. I only see a solid color and the only way it could be changed is by clicking on and off the crop relative.
 
Nope. I only see a solid color and the only way it could be changed is by clicking on and off the crop relative.
Success! Later I tried a shader source, "/Library/Application Support/obs-studio/plugins/StreamFX/data/examples/shaders/source/shadertoy-3tlXWS.effect" and it does modify the source size. Thanks.
 

Suslik V

Active Member
@Want To Learn mean while, if you are using latest OBS Studio, can you install the OBS Studio v.27.1.3 to see how Corner Pin 1.2 filter's preview works there (camera source)? Is there any difference?
 
@Want To Learn mean while, if you are using latest OBS Studio, can you install the OBS Studio v.27.1.3 to see how Corner Pin 1.2 filter's preview works there (camera source)? Is there any difference?
Will try it and let you know in a day or so. Work responsibilities. Thanks.
 

Suslik V

Active Member
...what I'm supposed to do here?

communicate?..

I was thinking that you will be interested in how StreamFX may interact with some algorithms. That's all. You have mac and have programming skill, your work was mentioned.
 
Top