how to stream live webcam in unity 3d? - webcam

At the moment i am being able to see my own webcam in unity3d as a texture using this simple tutorial
http://www.ikriz.nl/2011/12/23/unity-video-remake
Now i want to know that how can i see someone's else webcam in unity 3d?
can any body give me some pointers?

What do you mean under 'someone's else webcam'? Actually you can open socket connection between two computers, stream 'someone's else' webcam via socket and show a picture in your application.
An application for 'someone's else' can be written in any language/framework.

To help any one who would find this helpful in future, i have done this by using a flash client that takes the live stream and send it to a local server which was written in .Net.
and that .net server then sends the stream to our script which was running in unity3D. and that script was placed on any plane in your model , so showing you the received stream.
It was a bit laggy but it was working :)

Related

Server side real time analysis of video streamed from client

I'm trying to build a system for real-time analysis on server for video streamed from the client using WebRTC.
Here is what I currently have in mind. I would capture the webcam video stream from the client and send it (compressed using H.264?) to my server.
On my server, I would receive the stream and every raw frame to my C++ library for analysis.
The output of the analysis (box coordinates to draw) would then be sent back to the client via WebRTC or a separate WebSocket connection.
I've been looking online and found open-source media server like Kurento and Mediasoup but, since I only need to read the stream (no dispatch to other clients), do I really need to use an existing server? Or could I build it myself and if so, where to start?
I'm fairly new to the WebRTC and video streaming world in general so I was wondering, does this whole thing sound right to you?
That depends on how real-time your requirements are. If you want 30-60fps and near-realtime, getting the images to the server via RTP is the best solution. And then you'll need things like a jitter buffer, depacketization etc, video decoders, etc.
If you require only one image per second, grabbing it from the canvas and sending it via Websockets or HTTP POST is easier. https://webrtchacks.com/webrtc-cv-tensorflow/ shows how to do that in Python.

HDMI Splitter taking Input from Mac into capture card shutting off a channel

Hey so what I'm trying to do is take HDMI input (from a computer) to a splitter from which one channel goes to some viewing device (projector or something) while the other channel goes through a capture card into another system for some processing that I'm doing. However, four seconds after I connect my capture card to one of the splitter's output channels the splitter just stops outputting on that channel and essentially shuts that channel off (as seen by the LED on it). However, if I connect a projector to the other output channel it stays working fine on that.
Keep in mind that the input I'm using is from a MacBook Pro. When I switch the input to an Xbox 360 everything works absolutely fine. Also, if I connect the input (MacBook) directly to the system bypassing the splitter it works absolutely fine. Can someone explain what might be going wrong here when I put the splitter in the mix?
Here is the equipment that I'm using:
Splitter: http://www.gofanco.com/2-port-hdmi-splitter-4k-black-splitter2p.html
Capture Card: https://www.amazon.com/Video-Capture-Device-1080P-Grabber/dp/B01N4SM7H6/ref=sr_1_7?ie=UTF8&qid=1522955789&sr=8-7&keywords=full+hd+video+capture
Any help would be greatly appreciated :)
I would guess this may be an EDID issue. A display or capture device negotiates the best resolution and frame rate via EDID with your graphics card.
Now if you put the splitter in between the EDID based communication can go sideways.
HDCP could be another reason. Your splitter may not correctly handle or advertise HDCP

streaming webcam output over the internet using UDP protocol

I want to stream webcam output over the internet using UDP protocol (RTP to be specific). But I don’t have any ideas how to start to do so.
I have already tried using Microsoft DirectShow to get every frame as a jpeg file. I tried to send it using UDP but it was very slow.
I hope you could point me to the right direction .Also, if there are open source applications in java or c# that does this I will be very happy to work on them.
Thanks in advance
I am pretty sure that VLC (http://www.videolan.org/vlc/index.html) can do RTP.
Media menu
Stream...
Capture device tab
Set up as appropriate
Stream button
Next button
Change the "new destination" drop down to one of the RTP options
after this, I don't know, because I've never used RTP.
Good luck!

How to program midi messages to HUI Pro Tools uses?

I found some specs online but It wouldn't work for Play.
I tried
const UInt8 noteOn[] = {0x90, 127}; and it didn't work.
Does anybody know what midi messages to HUI Pro Tools uses for play and stop?
There are 2 main Protocols out there for controlling DAWs, Logic Control and Mackie Control (HUI). Unfortunately both are close protocols. Only recently Apple added support for TouchOSC (iOS application) and the OSC protocol (Open Sound Control) in general for Logic Pro, hopefully Pro Tools to follow (maybe it already did and I'm not updated, you better check it out).
If you want to reverse engineer the record/stop buttons and you own some sort of Mackie Control device, I recommend using Midi Monitor or LC Xmu to monitor what data gets in. Not sure whats there for PC users, on my PC era I used my Pro Soundcard.
If you don't own some sort of controller and looking around the internet for the answer please notice that these protocols have many versions that each manufacture tweak a little bit. On the other hand, there are not that many options, you can try them ALL :)
Anyhow, I program an iOS application that controls Logic Pro without using LC or MC at all. I opened Logic's Key Command and set the Midi Listen button of the Start/Stop on, then sent some Midi Note from my iOS application to calibrate the button. It worked well, but was not intuitive to users so I decided to give up.
You can send a midi machine control message through your virtual server with you virtual server, I had some success after reading this: http://en.wikipedia.org/wiki/MIDI_Machine_Control
Be sure to enable your virtual source as a mmc in your DAW. Also there is a Boolean check in the core midi docs you can use to verify that your program is sending the mmc messages, I believe it is something like kmidimachinecontrolenable, it is a coremidi constant and should not be hard to find.

NAudio decode stream of bytes

Hi
I am using the NAudio library at http://naudio.codeplex.com/
I have this hardware made by some manufacturer which claims to send
audio with the following characteristics.
aLaw 8khz, AUD:11,0,3336,0
Not sure what it all means at this stage.
I received bunch of bytes from this device when a user speaks into the
equipment.
Hence I am constantly recieving a stream of bytes at particular times
At this stage I have been unable to decode the audio so I can hear
what is spoken into the device with my headphones.
I have tried writing the audio to a file doing code like
FWaveFileWriter = new WaveFileWriter("C:\Test4.wav",
WaveFormat.CreateALawFormat(8000, 1));
And have been unable to playback the sound using the sample demo apps.
I have tried similar code from
http://naudio.codeplex.com/Thread/View.aspx?ThreadId=231245 and
http://naudio.codeplex.com/Thread/View.aspx?ThreadId=83270
and still have not been able to achieve much.
Any information is appreciated.
Thanks
Allen
If you are definitely receiving raw a-law audio (mono 8kHz) then your code to create a WAV file should work correctly and result in a file that can play in Windows Media Player.
I suspect that maybe your incoming byte stream is wrapped in some other kind of protocol. I'm afraid I don't know what "AUD:11,0,3336,0" means, but that might be a place to start investigating. Do you hear anything intelligible at all when you play back the file?