Search code examples
htmlamazon-web-servicesstreamingwebcam

Stream webcam from website to server


I would like to record the webcam of multiple clients while they perform a certain task through an HTML5 based website. Each client is free to sign in and start streaming any time.

The webcam should be streamed for two reasons. First, the users may suddenly disconnect, thus disabling the possibility of uploading the video after completing the task. Second, a task may take up to an hour, therefore the recorded video might take too long to be uploaded.

In the server side (Amazon Web Services based), I just want to store the streamed content into normal video files (using AWS S3, for example). One video file per user and session.

The question: what service/framework/package/piece-of-code would you recommend to implement a solution to satisfy the client and server side requirements?


Solution

  • The streaming requirement is key in this problem. Since we need to transmit the media data in real time, we have chosen a solution based in the open source WebRTC project.

    After considering several options, we decided to use Kurento to implement the webcam transmission and recording solution.

    Briefly, this is what you would need to do to set up a system where multiple users can stream their webcam and store it using Kurento:

    1. Launch an Ubuntu instance in AWS and install Kurento Media Server
    2. Please remember to set up the STUN server and open UDP ports in AWS
    3. Follow the hello world tutorial and verify that you can see yourself
    4. From the repository, pick the example project that best suits your needs (in this case it was kurento-tutorial-js/kurento-recorder)
    5. Test it and customize the code