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. |
25th February 2009, 12:59 | #1 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
OpenGl in Avisynth!
Here it's descriped how to use OpenGl in Avisynth. Youtube example here.
Unfortunately there is no downloadable plugin file, but the whole idear of adding OpenGl to Avisynth sounds great. Maybe someone with the right plugin writing skills could be inspired to take this even further? (I know... one of these days I need to take the leap into plugin writing myself).
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 5th March 2009 at 13:32. |
25th February 2009, 13:32 | #2 | Link | |
ffdshow/AviSynth wrangler
Join Date: Feb 2003
Location: Austria
Posts: 2,441
|
Quote:
np: Gold Chains & Sue Cie - Show Us Your Heart (When The World Was Our Friend)
__________________
now playing: [artist] - [track] ([album]) |
|
25th February 2009, 15:01 | #3 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
Do you think that this is a valid/okay way to add 3D manipulation of clips in Avisynth? (I guess the glut stuff can't be included in a plugin, and it might be a bit dated?) Or do you think there are better ways?
__________________
DVD slideshow GUI(Freeware). |
5th March 2009, 10:38 | #4 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
From simple scenes in Blender3D to OpenGL C / C++ code
Another interresting thing in this line of thought here.
This is a Blender 3D .py script which can make Blender 3D export to a OpenGl friendly format(For every scene exported, a corresponding .C and .H file is generated). I imagine that this combined with the stuff above it would be possible to use Blender 3D for making 3D transitions in Avisynth.
__________________
DVD slideshow GUI(Freeware). |
14th September 2009, 18:39 | #5 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
__________________
DVD slideshow GUI(Freeware). |
28th January 2010, 11:44 | #6 | Link | |
Registered User
Join Date: Mar 2005
Posts: 366
|
Quote:
__________________
DVD slideshow GUI(Freeware). |
|
7th May 2011, 18:15 | #8 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
Looks very interesting, but I'm pretty ignorant when it comes to c++.
__________________
DVD slideshow GUI(Freeware). |
12th June 2011, 17:07 | #11 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
Wow, looks brilliant! This must have taken a lot of time to code! Nice examples
Is it possible to process two videoclips in the lua script - for making transitions? Or devide a clip into two clips and make a transition between them?
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 12th June 2011 at 19:26. |
12th June 2011, 18:54 | #12 | Link |
Registered User
Join Date: Mar 2011
Location: Germany
Posts: 64
|
It's an avisynth plugin because it should use avs functions, like video splitting and merging, too. You can use FLuaG one time for saving video frames to .tga picture files and next round to use this pictures as video sequence or textures in another FLuaG call with another video.
|
12th June 2011, 19:30 | #13 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
I'm trying to look into the Gl functions.
Just a quick question: Is it possible to use a video as a texture on ex. a 3d box? What do you use for testing the lua scripts(as you wrote somewhere AvsP crashes with there are errors in the Lua script)?
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 12th June 2011 at 19:33. |
12th June 2011, 20:52 | #14 | Link |
Registered User
Join Date: Mar 2011
Location: Germany
Posts: 64
|
Save a video as .tga pictures and use picture-for-picture as texture for all cube sides - yes, it's possible.
For testing, i'm using AvsP but are careful. MPC hasn't this problem, because it allows error throwing during rendering too (AvsP just at the initialization of the plugin, bad programming fail). |
13th June 2011, 00:17 | #15 | Link | |
Registered User
Join Date: Mar 2005
Posts: 366
|
Quote:
Are there any tutorial/examples on that process you mention of working with video on 3d objects?
__________________
DVD slideshow GUI(Freeware). |
|
13th June 2011, 22:28 | #16 | Link | ||
Registered User
Join Date: Mar 2011
Location: Germany
Posts: 64
|
Quote:
Quote:
An example with the video on the cube in FLuaG: Code:
local w, h = flGetVideoWidth(), flGetVideoHeight() --Video resolution local d = 150 --Cube size --Render function function Video_Cube(frame_i) --Initialize 3D room flInit3D(FL_ORTHO, -1000, 1000) --Just draw the front of polygons (=faster rendering) glEnable(GL_CULL_FACE) glFrontFace(GL_FRONT) --Video to texture glEnable(GL_TEXTURE_2D) local tex = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, tex[1]) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, w, h, 0) --Clear frame to black glClearColor(0, 0, 0, 0) glClear(GL_COLOR_BUFFER_BIT) --Drawing texture with full colors glColor(255, 255, 255, 255) --List drawing of one rectangle with video on it local base = glGenLists(1) glNewList(base, GL_COMPILE) glBegin(GL_QUADS) glTexCoord(0, 0); glVertex(-d, d) glTexCoord(1, 0); glVertex(d, d) glTexCoord(1, 1); glVertex(d, -d) glTexCoord(0, 1); glVertex(-d, -d) glEnd() glEndList() --Set cube rotation and position to center glTranslate(w/2, h/2, 0) glRotate(frame_i/2, 1, 1, 0) --Draw front glPushMatrix() glTranslate(0, 0, d) glCallList(base) glPopMatrix() --Draw back glPushMatrix() glTranslate(0, 0, -d) glRotate(180, 0, 1, 0) glCallList(base) glPopMatrix() --Draw right side glPushMatrix() glTranslate(d, 0, 0) glRotate(90, 0, 1, 0) glCallList(base) glPopMatrix() --Draw left side glPushMatrix() glTranslate(-d, 0, 0) glRotate(-90, 0, 1, 0) glCallList(base) glPopMatrix() --Draw top glPushMatrix() glTranslate(0, -d, 0) glRotate(90, 1, 0, 0) glCallList(base) glPopMatrix() --Draw bottom glPushMatrix() glTranslate(0, d, 0) glRotate(-90, 1, 0, 0) glCallList(base) glPopMatrix() --Finish glDisable(GL_TEXTURE_2D) glDeleteLists(base, 1) end --Register render function for the whole video Register("Video_Cube", 0, flGetVideoFrames()) Decode a video into memory and load frame-per-frame as texture for an OpenGL 3D object. It's really simple. Last edited by Youka; 13th June 2011 at 23:57. |
||
14th June 2011, 20:02 | #17 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
WOW WOW WOW. That's super powerful!
Maybe I could just make two lua scripts(for transitions). Ex. - One with the first clip processed (on one side of the box)and the rest of the image transparent. - Process the second clip (on the other side of the box) with the rest of the image transparent. - Then overlay those two together on a background.
__________________
DVD slideshow GUI(Freeware). |
14th June 2011, 20:33 | #18 | Link |
Registered User
Join Date: Mar 2005
Posts: 366
|
Did a quick test with your Lua script and plugin in DVD slideshow GUI:
(I wish that this forum would allow posting of videos directly in the thread) http://www.youtube.com/watch?v=ofTm1A3GNN4
__________________
DVD slideshow GUI(Freeware). Last edited by tin3tin; 14th June 2011 at 20:36. |
Thread Tools | Search this Thread |
Display Modes | |
|
|