Skip to content

Commit

Permalink
Merge pull request luxonis#118 from luxonis/moved_mjpeg_streaming
Browse files Browse the repository at this point in the history
Moved mjpeg streaming
Erol444 authored May 4, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 1fd193d + 7ed1e92 commit d0b5d12
Showing 8 changed files with 39 additions and 80 deletions.
34 changes: 34 additions & 0 deletions gen2-mjpeg-streaming/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[中文文档](README.zh-CN.md)

# MJPEG Streaming server

This script allows you to:
- Stream frames via HTTP Server using MJPEG stream
- Stream data via TCP Server

## Demo

[![MJPEG Streaming DepthAI](https://user-images.githubusercontent.com/5244214/90745571-92ab5b80-e2d0-11ea-9052-3f0c8afa9b0b.gif)](https://www.youtube.com/watch?v=695o0EO1Daw "DepthAI on Mac")


## Installation

```
python3 -m pip install -r requirements.txt
```

## Usage

Run the application

```
python3 main.py
```

To see the streamed frames, open [localhost:8090](http://localhost:8090). This works in Chrome, but not Firefox or Safari.

To see the streamed data, use

```
nc localhost 8070
```
File renamed without changes.
5 changes: 4 additions & 1 deletion mjpeg-streaming/main.py → gen2-mjpeg-streaming/main.py
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import cv2
from PIL import Image

HTTP_SERVER_PORT = 8090

class TCPServerRequest(socketserver.BaseRequestHandler):
def handle(self):
@@ -59,7 +60,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):


# start MJPEG HTTP Server
server_HTTP = ThreadedHTTPServer(('localhost', 8090), VideoStreamHandler)
server_HTTP = ThreadedHTTPServer(('localhost', HTTP_SERVER_PORT), VideoStreamHandler)
th2 = threading.Thread(target=server_HTTP.serve_forever)
th2.daemon = True
th2.start()
@@ -102,6 +103,8 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
# Start pipeline
device.startPipeline()

print(f"DepthAI is up & running. Navigate to 'localhost:{str(HTTP_SERVER_PORT)}' with Chrome to see the mjpeg stream")

# Output queues will be used to get the rgb frames and nn data from the outputs defined above
q_rgb = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
q_nn = device.getOutputQueue(name="nn", maxSize=4, blocking=False)
File renamed without changes.
File renamed without changes.
35 changes: 1 addition & 34 deletions mjpeg-streaming/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
[中文文档](README.zh-CN.md)

# MJPEG Streaming server

This script allows you to:
- Stream frames via HTTP Server using MJPEG stream
- Stream data via TCP Server

## Demo

[![MJPEG Streaming DepthAI](https://user-images.githubusercontent.com/5244214/90745571-92ab5b80-e2d0-11ea-9052-3f0c8afa9b0b.gif)](https://www.youtube.com/watch?v=695o0EO1Daw "DepthAI on Mac")


## Installation

```
python3 -m pip install -r requirements.txt
```

## Usage

Run the application

```
python3 main.py
```

To see the streamed frames, open [localhost:8090](http://localhost:8090). This works in Chrome, but not Firefox or Safari.

To see the streamed data, use

```
nc localhost 8070
```
Moved to https://github.com/luxonis/depthai-experiments/tree/master/gen2-mjpeg-streaming
7 changes: 0 additions & 7 deletions mjpeg-streaming/mobilenet-ssd/config.json

This file was deleted.

38 changes: 0 additions & 38 deletions triangulation-3D-visualizer/README.zh-CN.md

This file was deleted.

0 comments on commit d0b5d12

Please sign in to comment.