Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity3D Webcam Toolkit for Windows

Discussion in 'Made With Unity' started by Christian, Sep 21, 2009.

  1. Christian

    Christian

    Joined:
    Dec 2, 2008
    Posts:
    24
    This Plugin gives access to local connected Webcams. The Plugin grabs a single Webcam Image and copies the pixel data in an ordinary Unity3D Texture which can be used by any Unity3D Shader. It's possible to grab a single image or a whole webcam stream.

    A known performance issue appears when using higher cam-resolutions. That's because the Unity3D function SetPixel() for every pixel of the webcam image is called every frame. If someone has an idea to speed up the transfer between cpu and gpu memory, please let me know.

    A free beta version is available on our website: http://produktion.weltenbauer.com on the "entwicklungen." section.

    This project uses the CodeVis VidCap library.
     

    Attached Files:

  2. degeneration

    degeneration

    Joined:
    Apr 3, 2008
    Posts:
    115
    Good work, but does it support sound?
     
  3. Christian

    Christian

    Joined:
    Dec 2, 2008
    Posts:
    24
    Sound support is not included but could be an option in the future.
     
  4. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Hopefully webcam support will make it sometime into the webplayer. Shame to see Unity3d miss on the AR hype ...
     
  5. DaveA

    DaveA

    Joined:
    Apr 15, 2009
    Posts:
    310
    This sounds great, but I have installed it on several machines with different cameras, and all I get is a screen with a white box and a blue box with 'webcam control' at the top. I've seen it work on another machine, so I know what to expect.
    The docs are non-existant? Or where are they?
    What DLL's do I need, and where to they go (I put ImageGraber.dll and VidCapDll.dll in the same folder as my exe, no luck).
    Thanks
     
  6. realvision

    realvision

    Joined:
    Apr 10, 2009
    Posts:
    1
    Hi all,
    I especially re registered on the forum to ask about the Webcam plugin.

    Does it not work on Windows Vista 64?
    the moment I try to run the demo it crashes Unity3D rather badly.

    My webcam works fine in other programs, so i know its accessible properly.

    Any clues?

    Thnkas
     
  7. Musiscient

    Musiscient

    Joined:
    Aug 9, 2009
    Posts:
    1
    Thanks for this resource!

    Works well with Windows XP 32

    Download VidCapture here http://sourceforge.net/projects/vidcapture/files/

    Unzip, install the.exe of VidCapture,

    Then, Unrar WebCamToolkit_v01_beta, and from the folder /UnityWebcamToolkit/Assets/Plugins/ copy the file ImageGraber.dll into WINDOWS/System32

    launch Unity on the demo, that's work fine !

    But.. Any idea how to start for networking use? I'm using Unity with SmartFoxServer...

    Thanks again!
     
  8. extragotcha

    extragotcha

    Joined:
    Mar 20, 2009
    Posts:
    42
    Christian,

    This is great stuff !

    Hopefully, Unity's texture writing/pixel-setting will be extended soon so that we can experience your plugin with optimal framerates.

    Have you looked into blitting (then possibly rendering to texture if the texture needs to be mapped)?
    Could it be a possible workaround in the meantime?
     
  9. knowtheneo

    knowtheneo

    Joined:
    Nov 20, 2009
    Posts:
    6
    Hi, I have been trying to get both the Unity AR - tool kit as well as just the webcam Toolkit to run. But All I get is a blank white box, and a "error connecting to device" while running on the editor.

    I have looked into http://forum.unity3d.com/viewtopic.php?t=32669 as well. Tried copying the ddls and running in editor as standalone - nothing has worked!

    Can someone please throw some light on what else I am missing? I got Unity Pro2.6 trial, and using Microsoft LifeCam
     
  10. lyh1

    lyh1

    Joined:
    Jun 30, 2010
    Posts:
    92
    Just added Mac support for UnityAR. The XCode project is in the project root folder.
    Now it only use ARToolKit, No CodeVis VidCap dependence.
    Some functions removed because they don't support by ARToolKit.
    If you find image is flipped due to some reason, I added the flip implementation to the demo for easy of use.

    There are some dirty macros to make it built on both VS and Xcode. I have no idea how to clean them up sorry.:cry:

    edit: I re-uploaded the file. I have no idea why everytime I attach it to here, it will show uploading empty file error.
    If this link is not work, I may upload it to other free space.

    Source + demo:
    http://rapidshare.com/files/406910210/UnityAR_v01_beta_Mac.zip.html

    Mirror:

    http://cid-b09cde3cb849642d.office.live.com/self.aspx/Public/UnityAR^_v01^_beta^_Mac.zip
     
  11. kaaJ

    kaaJ

    Joined:
    Mar 21, 2007
    Posts:
    150
    Very Nice! But the OSX-version download does not seem to work.
    Could you upload it again?

    Thanks!
    kaaJ
     
  12. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    I opened it up and when I press play it crashes. What do I do?
     
  13. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Is there no way you can use setPixels instead of setPixel?
     
  14. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    you can but the difference is not really impacting.

    setpixel isn't the bottleneck, Apply is, cause the whole texture must be reuploaded to the gpu every frame.
     
  15. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    That wasn't my experience, setPixels is way quicker than looping through every pixel and using setPixel. Sure there is probably a much bigger bottle neck with Apply but if you are looking for every bit of performance increase.
    Of course if you still have to loop through every pixel to build the array that setPixels uses then I can see there won't be much benefit.
     
  16. interactiveboy

    interactiveboy

    Joined:
    Jul 31, 2009
    Posts:
    21
    The Mac link is invalid. (both of them) after download, decompression fails.

    Why leave this to be another piece of digital junk in the wasteland that is the net? Why not fix it by re-uploading or provding a valid link?

    This is a shame.
     
  17. dart

    dart

    Joined:
    Jan 9, 2010
    Posts:
    211
    The guy wrote the code and made it available to everybody. He could just keep it to himself and most probably has his own schedules and work to do besides sharing his code for free. If you think it´s a shame, don´t bother going there to download it and write your own code.
     
  18. Kourosh

    Kourosh

    Joined:
    Jul 18, 2010
    Posts:
    15
    I'm very much excited about this camera toolkit and possibilities in Unity thanks for the toolkit. I'm using windows Vista 64 and unity3d 2.6 pro trial. Every time i play the example project unity crashes. But whenever i build run the project everything looks fine and it works. does anyone know what could be the problem?
    thanks
     
  19. yangcheng

    yangcheng

    Joined:
    Apr 29, 2009
    Posts:
    18
    HI,Christian .first,thanks for your UnityAR_v01_beta.Can I ask you a question?about UnityAR_v01_beta. i'm having a problem with "getDetectedTranslationRotation" when i took out the marker, the object stays in the plane, and don't go to the standard position. How dofix that?
     
  20. Krodil

    Krodil

    Joined:
    Jun 30, 2010
    Posts:
    141
    hi,
    just a quick one.
    Cant find the exe, when I unpack the VidCap.rar
    Any guides?
    Im on Win7
     
  21. TWest

    TWest

    Joined:
    May 26, 2009
    Posts:
    131
    A way in which to speed up the SetPixel or SetPixels would be awesome I have a project I am using SetPixels on extensively and the only way that I have found to make it faster is to degrade the quality.
     
  22. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    is this going to work in a webplayer?
    thanks
     
  23. qw_zzz

    qw_zzz

    Joined:
    Nov 26, 2010
    Posts:
    16
    hi, i went to your site, but the webcamtoolkit is not found anywhere, would u mind uploading here?
     
  24. lyh1

    lyh1

    Joined:
    Jun 30, 2010
    Posts:
    92
  25. PepeSIA

    PepeSIA

    Joined:
    Aug 25, 2011
    Posts:
    1
    I find that is a problem getting the stream from a Microsoft Cinema , if is a Kinect conected .
    And more important Issue , is when I try to use the UnityArLib.dll pluggin in a proyect started in unity 3.4 PRO . do any know abbout this problems ?

    PD : Sorry my Inglish , im from Argentina :).
     
  26. Cod101

    Cod101

    Joined:
    Aug 25, 2011
    Posts:
    13
    3D games with a webcam, great idea!
     
  27. murtaza1122

    murtaza1122

    Joined:
    Mar 11, 2012
    Posts:
    1
    Can you please give link of WebCamToolkit_v01_beta . Thanks