Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Need help with Green Screen type of effect from live video.

Author
Message
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 1st Sep 2010 21:20
I'm going to be shooting some video of a person, and can have whatever color background I want behind them. (basically a photo shoot where I'm in control of the environment.)

I want to put something behind them that I can pull that video into DBPro and change that background to whatever I want. Probably a different video, or a still image.

If there is another program that can do this I'm open to that, but I'm guessing if I have the background all 1 color and make sure that color ISN'T anywhere on the person, then I can put that video on a plane with transparency and set the color key to that color. Then put my chosen background on another plane behind that.

I'm just asking here if there is a better way that has been tried, or perhaps a shader out there that does this?

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Sep 2010 21:48 Edited at: 1st Sep 2010 21:49
That's interesting.

I haven't tried it, but I bet you could do it with memblocks or a shader. If you loaded it with LOAD ANIMATION and played it with PLAY ANIMATION TO IMAGE (if that command works, I haven't tried to use it with memblocks or a shader before) then it might work. You would just cycle through the pixels and if they were green (or close to green) then you would set the alpha value to 0. Otherwise you would leave it as is.

All of this assumes that the PLAY ANIMATION TO IMAGE command works though. If it didn't work with memblocks then it might work with a shader, but even then I'm not sure...

There are probably lots of other programs that would do this fairly easily for you though.


Guns, cinematics, stealth, items and more!
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 1st Sep 2010 21:59
Well the only problem I see with that is converting those separate images back into a video.

My computer surpasses all the technologies of the day. What computer do I have?

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Sep 2010 22:11
Quote: "Well the only problem I see with that is converting those separate images back into a video."


Good point . Maybe that AVI plugin could work? It would take a while to render though.


Guns, cinematics, stealth, items and more!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd Sep 2010 03:08 Edited at: 2nd Sep 2010 03:48
I was thinking the same thing. Using the AVI plugin, or perhaps even Fraps to capture the resulting video is what I had in mind.

I need to learn more about memblocks anyway, so this sounds like a good time to do that.

OR

Wait for Green Gandalf to chime in and suggest using a shader.

I'm still digging around to see if there is another program that could do it too, but there are other special effects I want to add in to the result that would work better inside DBPro. Although I can still do those as an after effect too.

Come to think of it, I have an older version of Adobe Premier Pro. I seem to remember something about it being able to do background replacement..

[edit]
Yes, Adobe Premier Pro will do it. Although I would have to make my effects in DBPro and export that as a separate video to then be melded with the first in Premier. I'm still going to give it a try with memblocks and see what happens.

Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 2nd Sep 2010 03:54 Edited at: 2nd Sep 2010 03:54
Alright, well at least you've got a backup now! Anyway let me know if the memblock thing works . If not I could try my hand at making a simple shader...


Guns, cinematics, stealth, items and more!
Mugen Wizardry
User Banned
Posted: 2nd Sep 2010 04:01
its easy. just create a camera using make camera =D

end of story XD

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD! http://www.imageposeidon.com/
Daniel wright 2311
User Banned
Posted: 2nd Sep 2010 04:06 Edited at: 2nd Sep 2010 04:07
here you go, it does it all

[href]pop video converter[/href]

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Sep 2010 14:46
You can't use transparent colours from an animation played to image. Even setting the colorkey or the alpha levels do not seem to work.

My signature is NOT a moderator plaything! Stop changing it!
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 2nd Sep 2010 15:55
Well memblocks would actually be quite easy. You just loop through each animation frame and check each pixel if its red and blue are low and the green is high enough.

My computer surpasses all the technologies of the day. What computer do I have?

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd Sep 2010 20:27
@Madscientist
That sounds like the method that's actually going to work the best.
It might be slow, but any good special effects rendering system usually is.

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 2nd Sep 2010 21:13 Edited at: 2nd Sep 2010 21:15
I think you would be better off using a dedicated video app to process the frames and then create a new video with an absolute `transparent` colour. The problem with rgb comparisons will be the range considered `transparent`. Too small and it won't remove all the greenscreen, too loose and it will start removing image data that you want to keep. I'm betting that commercial software to do greenscreen removal is fairly processor-intensive and complex.

Edit: Esp if you're filming people then the problem is `soft` borders between person & background such as hair. Plenty of old film examples of bad super-imposing!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Sep 2010 21:24
Quote: "Plenty of old film examples of bad super-imposing!"

Not even old films! I watched the expendables last night and clearly Sylvester Stallone and Arnie "The Governator" were not in the same room at the same time!

THAT was bad superimposing! lol

My signature is NOT a moderator plaything! Stop changing it!
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 3rd Sep 2010 02:19
I wish that hadn't been a movie all about Stalone. It could have been so much better if they were all equally billed, and Arnold and Bruce could have devoted more time to the project.

Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 3rd Sep 2010 02:49
Back to the topic...

If you do the video shoot, make sure you light the background evenly. Otherwise no amount of software will help you. No shadows, no hot spots, etc. Please ignore if you already know this.

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 3rd Sep 2010 21:06
The easiest way to get lighting right is to do it outside when it is a sunny afternoon.

My computer surpasses all the technologies of the day. What computer do I have?

Softwizz
17
Years of Service
User Offline
Joined: 14th May 2009
Location: U.K.
Posted: 4th Sep 2010 16:44 Edited at: 4th Sep 2010 16:47
use sony vegas

or try this with 'windows movie maker':
http://www.wikihow.com/Chroma-Key-in-Windows-Movie-Maker

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 4th Sep 2010 19:33
Quote: "or try this with 'windows movie maker':
http://www.wikihow.com/Chroma-Key-in-Windows-Movie-Maker"


Great tip! I use WMM all the time for transferring home vids but I didn't know that was so quick & easy. I will definitely be trying it, cheers!

Login to post a reply

Server time is: 2026-07-22 19:27:25
Your offset time is: 2026-07-22 19:27:25