Jump to content

Video to texture via libtheoraplayer


Niosop
 Share

Recommended Posts

Well, it took me two days and the final result was like 12 lines of code, so I feel pretty dumb. But, I learned a lot and found the AWESOME libtheoraplayer library, so I'm happy. Doing this brought up some issues, like not having the ability to load vorbis sound data from an ogg theora+vorbis file, and the lack of features to help with syncing sound to video. But all in all it is actually REALLY easy to do and performs very well. You can see a short demo here:

 

Performance is excellent. Due to libtheoraplayer being multithreaded, I actually get almost no impact to framerate because of the decoding process, although this only helps on a multicore system with a free core to do the decoding. Minimum I saw was 80FPS for that scene when not using FRAPS. Just rendering the video to a surface alone was giving me about 250FPS.

 

I'm thinking about writing a shader to do the Y'CbCr->RGB conversion, but with it being on a separate thread it might actually hurt performance on multicore machines. Will try it out sometime and let you guys know. The video playing is Elephant's Dream, the house is by GIMPY73.

  • Upvote 4

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

Now that's impressive and two days well spent, nice job Niosop :)

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

Wow cool! I love how the brightness of the TV screen works as a light too, but a colored like Josh said would add a huge realism and should be quite easy to do too.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Actually it is colored. The video is crappy quality but there's a point light right in front of the screen. Every loop it takes the average color of the screen and changes the point light to that color.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

It would be cool if we actually had some source code to look at...

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

It would be cool if we actually had some source code to look at...

We have: http://leadwerks.com/werkspace/index.php?/topic/741-video-playing-example/page__view__findpost__p__6579

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...