How to send webcam video to Amazon AWS EC2 Instance

十年热恋 提交于 2020-12-29 07:57:27

问题


Suppose I want to stream video captured by my webcam to an Amazon AWS EC2 Instance for the purposes of image processing in the cloud. How would one do this? The only means for file transfer that I am aware of, is scp to copy files to the remote host. I have no idea where to begin in regards to streaming video to AWS EC2. Google turned up nothing for me. Any ideas?


回答1:


Here is what worked. There are likely many other methods. 1) Create a free tier Amazon AWS EC2 instance with Ubuntu Server 16.04 2) Go to the security groups, and modify the security group to allow TCP traffic to reach your instance 3) Note the public ipv4 address of your instance 4) Develop client code to open network sockets, and send data to them (Python 2.7 has the socket package) 5) Develop server code to open network sockets, and listen/accept connection (Python 2.7 works). 6) Client side needs to generate video frames from the webcam, and this is done quite easily using OpenCV2 within Python. A great reference was the answer posted in this thread: Send Live Video OpenCV Python




回答2:


The only means for file transfer that I am aware of, is scp to copy files to the remote host.

An AWS EC2 instance can largely be treated just like any other server.. just in the Cloud. If you want to connect to it, install some software, open ports, whatever, all of that is do-able.

I'm assuming you want to "stream" video from a webcam to the EC2 instance.

You need some kind of client software where the webcam is connected to stream it to the EC2 instance. You would assign an Elastic IP to the instance and configure that software to stream it to the address.

You would then need to install or build something on the server to receive the stream and do something with it. Either save it somewhere for processing, do some live processing and stream it somewhere else, etc.

Each of these components are broad subjects and can't really recommend any particular software to accomplish this. The important part here though is that the EC2 instance can do all of this, assuming you find or build software to handle all of these tasks.



来源:https://stackoverflow.com/questions/44506323/how-to-send-webcam-video-to-amazon-aws-ec2-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!