Hello, I joined basically to ask how feasible it would be to take a video stream and make it appear on a surface for in game.
I have done a certain amount of due diligence researching the topic but have found nothing that covers exactly what I want to do.
======================
Stuff I read after googling to the furthest extent of my googling skillshttp://lists.ioquake.org/pipermail/ioquake3-ioquake.org/2010-April/004077.html"In theory, this isn't too hard (well, at least the case of a camera in the corner of the screen)."
"If you want to use a video as a texture (now we're getting tricky)," he then goes on to say he does not think a swf could be used but a swf really is not the same as streaming video so I am not taking that as a solid it is impossible.
"You'd probably need to add code to the main loop to update any "video
textures", and if done properly, there shouldn't be much to change on the actual rendering."
I think this is true, well maybe true. It might be able to be done in the form of a shader.
http://www.quake3world.com/forum/viewtopic.php?f=10&t=44888This script that is no longer around to be downloaded for me to look at uses shaders to change what the displayed texture is, well it says it does this by changing the alpha setting. So it is not exactly just switching textures mid playthrough.
http://wiki.blender.org/index.php/Dev:Source/GameEngine/2.49/VideoTexturehttp://www.tutorialsforblender3d.com/Game_Engine/VideoTexture/VideoTexture_Movie_1.htmlBlender's - Game Engine -Video Textures give some insight into probably how this should work in an ioquake based game. It explains that it gets a texture and replaces it with a temporary new texture and then each cycle of the game engine it calls refresh on the texture. All this method does is invalidate the texture and when it loads the texture again it loads the new texture instead. From the games perspective it just keeps loading the same texture over and over again, every frame. This seems like a much more backward compatible approach.
A large square texture is added to some map. On a standard client it is a standard texture. On a modified client the texture is just updated provided the video loads.
I have done some programing into getting raw youtube streams. It is not that hard, well given api support anyway. Either the youtube video id is used to call up the video information packet and then parsed for the list of streams or the main youtube html is loaded up as a browser would and then parsed for the list of streams. There are usually around 5 different video streams of different types an quality. The logic then goes to just check what if available and then load whatever fits the preferred quality best.
However there is still the matter of getting something to decode a video that is still downloading. FFmpeg seems to get used in a lot of projects. It is under GPL like open arena but I don't know if it is suited to reading from a buffering video file. It seems to like to take a file, decode it, and then send it elsewhere. Either to a file, or onto the internet as a video stream. I have not looked at the code for voip or saving video but I would not be surprised if one of them uses FFmpeg. Anyway if it is not the right tool for the job I know there is a right tool for the job. Just needs some digging to find it.
========================
APPLICATION OF DOING ALL THIS: In which there are fanciful delusions of everything working out perfect.
Basically I like group youtube. There are a few of them out there. A chat program hooked up to a video player for youtube videos. In the example I like you just say "tv play oO3Miysfhss" or posts the youtube link
https://www.youtube.com/watch?v=oO3Miysfhss and the video plays. Upon posting a video link the video goes into a loto along with all other videos posted by users and one is chosen, max one per user, and then the video is played and the loto is emptied. The beauty of the system is that is just needs a few lines of text to be passed from the server to the clients. That being what video won by youtube ID and how far into the video it currently is. That way everyone sees the video at the same time and it is a group experience. Because some videos are long and or annoying the video only plays for a certain amount of time plus additional time if users say "tv yay". Saying "tv sux" does the opposite. A leveling system determined the power of tv yay and tv sux. But in a first person shooter it could be based on something like number of frags or ranking.
This idea could be super slick and polished but it could also just be implemented as text sent from the server that is then interpreted client side by a script so that video playback is synched. All the server would need to do is keep track of what videos are submitted and randomly pick one, and then keep track of how far into the video it is. So long as everyone calculates video timelock by the same rules videos will stay in sync.
Obviously you'd be hard pressed to watch a video and play OpenArena at the same time but you could casually frag some of your friends while that plays and when you are bored of fragging you can go back to videos. In my experience people would probably find it funny to post trolling videos, or videos that directly relate to the situation at hand. But people aslo like to post a lot of music videos. When they find a new video they like they like to share it. People get into posting the same video over and over and joking about it. Or watching some marathon of some series with other people. I just think that this social behavior would be more enjoyable with the application of more rockets.
AlsoOh and if it was figured out how to do video replacement of a texture then photos, or webcam probably would not be hard to implement from that point. And the webcam ability is something people have apparently been looking into for a while.
Also AlsoObviously webcams, photos, youtube could all be abused but people can always be kicked from a server.