AggrorJorn Posted August 8, 2010 Share Posted August 8, 2010 I am at a point where I want to add video into my project. Now I know that Niosop made this great video library for Lua called LibTheora player. However I recall there was this video about it how to use it, but I can't seem to find it. I am trying to get the video's to play inside as well as outside the editor, but with no luck. C++ version: http://leadwerks.com/werkspace/index.php?/topic/730-video-to-texture-via-libtheoraplayer/page__hl__theora showcase: http://leadwerks.com/werkspace/index.php?/topic/741-video-playing-example/page__p__6579#entry6579 download section: http://leadwerks.com/werkspace/index.php?/files/file/89-letheorazip/ Does anybody have a working Lua example of how things work? Steps taken so far: extracted the lib theora file,shaders, lua scripts in to the game project. added a .ogg video inside the projectthis code:require("Scripts/constants/keycodes") require("Scripts/math/math") require("Scripts/video") RegisterAbstractPath("") Graphics(1440,900,32) fw=CreateFramework() cube = CreateCube() cube:SetPosition(Vec3(0,0,5)) video = TheoraClip:new() videoMat:CreateMaterial("video.ogg", video) cube:Paint(videomat) video:Play() while KeyHit(KEY_ESCAPE)==0 do fw:Update() fw:Render() Flip(0) end Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 8, 2010 Share Posted August 8, 2010 do you have all of the dll's in the SDK's root directory? i think there are three of them... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2010 Author Share Posted August 8, 2010 Yips, I have the following files: libtheoraplayer.dll (root) letheora.dll (root) lua51.dll (root) lua5.1.dll (root) video.mat (root) video.ogg (root) nio_util.lua (inside scripts folder) video.lua (inside scripts folder) mesh_video.frag (placed inside the shader.pak/mesh folder) Quote Link to comment Share on other sites More sharing options...
cocopino Posted August 8, 2010 Share Posted August 8, 2010 Is Gimpy's tv working? http://leadwerks.com/werkspace/index.php?/files/file/82-old-tv/ Quote desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32 Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2010 Author Share Posted August 8, 2010 That comes in handy, but it crashes as soon as it is being placed in the scene. Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 8, 2010 Share Posted August 8, 2010 try it in an older version of LE... like 2.31, cause it worked fine there... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2010 Author Share Posted August 8, 2010 so far it has crashes in 2.4 and 2.32r5. downloading 2.31 Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted August 8, 2010 Share Posted August 8, 2010 Gimpys Old TV using Nio's video material works for me in both 2.4 and 2.32r5 Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2010 Author Share Posted August 8, 2010 I must be forgetting something. Do you have the same files as I do? libtheoraplayer.dll (root) letheora.dll (root) lua51.dll (root) lua5.1.dll (root) video.mat (root) video.ogg (root) nio_util.lua (inside scripts folder) video.lua (inside scripts folder) mesh_video.frag (placed inside the shader.pak/mesh folder) Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted August 8, 2010 Share Posted August 8, 2010 Do you have the same files as I do? no ... mine work On a serious note libtheoraplayer.dll (SDK root) letheora.dll (SDK root) lua51.dll (SDK root) lua5.1.dll (SDK root) video.mat (Materials root) bunny.ogg (SDK root) nio_util.lua (scripts root) video.lua (scripts root) mesh_video.frag (placed inside the shader.pak/mesh folder) Make sure old-tv.lua does have the right path to the correct .ogg file Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2010 Author Share Posted August 8, 2010 thx marley, the editor version is working now. I made the mistake of using the abstract function for finding the video. Only thing left to find out is getting it to work outside the editor. require("Scripts/constants/keycodes") require("Scripts/math/math") require("Scripts/video") RegisterAbstractPath("") Graphics(1440,900,32) fw=CreateFramework() camera = fw.main.camera camera:SetPosition(Vec3(0,10,0)) light = CreatePointLight(10) scene = LoadScene("abstract::scene.sbx") --------------------------------------------- -- Video is loaded on a cube. --------------------------------------------- cube = CreateCube() cube:SetPosition(Vec3(0,10,5)) TheoraVideo:Init() videoclip = TheoraVideo:CreateMaterial("video.ogg", "Videotest") cube:Paint(videoclip,1) videoclip:SetLoop(1) --videoclip:Play(1) --------------------------------------------- -- Video is loaded on a cube. --------------------------------------------- camRotation=Vec3(0,0,0) MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) HideMouse(1) while KeyHit(KEY_ESCAPE)==0 do --Camera look gx=Curve(MouseX()- GraphicsWidth()/2,gx,10) gy=Curve(MouseY()- GraphicsHeight()/2,gy,10) MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) camRotation.x = camRotation.x+gy /10 camRotation.y = camRotation.y-gx /10 camera:SetRotation(camRotation,1) --keys move = Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,10) strafe = Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,10) camera:Move(Vec3(strafe /11,0,move/11)) fw:Update() fw:Render() Flip(0) end I am sure that there was this video or article were Niosop showed how to set this up. I have send him a message. Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted August 8, 2010 Share Posted August 8, 2010 getting it to work outside the editor Not 100% sure what you mean by that. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2010 Author Share Posted August 8, 2010 atm the video plays inside the editor attached via an object, but now I am trying to run it in a game script outside the editor. The video is not loaded via a lua script that belongs to a model. see the script in my reply above. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.