Stream Video from AWS DeepLens to OpenCV

While the AWS DeepLens camera is designed to work with AWS, it’s just a normal linux camera and you can open video streams from OpenCV.

The camera comes with a firewall (UFW) pre-installed, so you need to disable a port for video:

sudo ufw allow 8090

Then edit the ffserver configuration file to expose the streams from the camera:

sudo vi /etc/ffserver.conf

Add the following:

  File "/opt/awscam/out/ch2_out.mjpeg"

  File "/opt/awscam/out/ch1_out.h264"

Then run ffserver.

Now you can access this remotely with Python:

import cv2
import datetime
camera = cv2.VideoCapture('')
while True:
  (grabbed, frame) =
  if not grabbed:
  frame = cv2.resize(frame, (int(1920/4), int(1080/4)), cv2.INTER_AREA)
  cv2.putText(frame,"%A %d %B %Y %I:%M:%S%p"),
    (10, frame.shape[0] - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.35, (0, 0, 255), 1)
  cv2.imshow("Feed", frame)
  key = cv2.waitKey(1) & 0xFF
  if key == ord("q"):

Leave a Reply

Your email address will not be published. Required fields are marked *