Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Hesta · Feb 05, 2013 at 01:49 PM · networkvideostreamingrealtimewebcam

Video call in Unity?

Is it possible to make two computers engage in a video call (across a network)?

I'm working on a project to design a virtual campus (Where players/students can design their avatars, attend lectures, talk with friends,.. etc). A part of it is where a professor can do a realtime online video streaming - resembling a lecture, another is where two students can chat with each other via video call.

So, my question is: Is this possible? And if it is, can you give my any guidelines on what to do/learn? I've already applied some tutorials on how to make a basic MMO, and on capturing video from a webcam & displaying it on a game object. But I can't seem to merge them together.

Your help is much appreciated :)

EDIT: 8 March. I've managed to write a script to transfer the data from the webcam over the network. It gives a blank page on the receiver's end, but it's something :)

 #pragma strict
  
 var webcamTexture : WebCamTexture;
 var data : Color32[];
  
  
 function OnServerInitialized() {
         webcamTexture = WebCamTexture();
         renderer.material.mainTexture = webcamTexture;  
         webcamTexture.Play();
         data = new Color32[webcamTexture.width * webcamTexture.height];
 }
  
 function Update () {
     webcamTexture.GetPixels32 (data);
 }
  
 function OnConnectedToServer() {
     networkView.RPC ("WebcamStream", RPCMode.Others, data, webcamTexture);
     webcamTexture.Play();
 }
  
 @RPC
 function WebcamStream (data : Color32 [], webcamTexture: WebCamTexture) {
     var    newwebcamTexture: WebCamTexture = webcamTexture;
     renderer.material.mainTexture = newwebcamTexture;
     var newdata: Color32[] = data;
     webcamTexture.GetPixels32 (newdata);
 }
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Landern · Feb 05, 2013 at 01:57 PM

Unity does have a system for web cam's, please look at the documentation WebCamTexture.

Edit: Read the rest of your question. You will have to transmit the frames after say encoding them as a byte array or some other form to the connected users, decode it back and create a texture, rinse repeat. You will want to use in particular the GetPixel/GetPixels/GetPixel32 functions/methods of the WebCamTexture class.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Hesta · Feb 05, 2013 at 02:23 PM 0
Share

Can you please elaborate how to do this? I'm not very good in coding :)

avatar image Suhani_29 · Jun 08, 2017 at 09:03 AM 0
Share

Hie landern, can you give me your email id?

avatar image SohailBukhari Suhani_29 · Jun 08, 2017 at 11:53 AM 0
Share

This post is 4 years old many things has been deprecated.Post your question if you have problem in video calling unity.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can Unity play live streamed video and audio sources continuously? 1 Answer

Streaming in Unity - Poor performance issue. 1 Answer

Is it possible to display inside your game a mirror of the desktop behind the game you are running? 1 Answer

Can I download videos at runtime? 3 Answers

how to send live audio from mobile to desktop app via wifi 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges