diff --git a/Makefile b/Makefile index c28d0c824..845024f59 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,6 @@ version: web: docker build --tag frigate-web --file docker/Dockerfile.web web/ -jsmpeg: - docker build --tag frigate-jsmpeg --file docker/Dockerfile.jsmpeg jsmpeg/ - amd64_wheels: docker build --tag blakeblackshear/frigate-wheels:1.0.3-amd64 --file docker/Dockerfile.wheels . @@ -20,7 +17,7 @@ amd64_ffmpeg: nginx_frigate: docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate-nginx:1.0.0 --file docker/Dockerfile.nginx . -amd64_frigate: version web jsmpeg +amd64_frigate: version web docker build --tag frigate-base --build-arg ARCH=amd64 --build-arg FFMPEG_VERSION=1.1.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate --file docker/Dockerfile.amd64 . @@ -32,7 +29,7 @@ amd64nvidia_wheels: amd64nvidia_ffmpeg: docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-amd64nvidia --file docker/Dockerfile.ffmpeg.amd64nvidia . -amd64nvidia_frigate: version web jsmpeg +amd64nvidia_frigate: version web docker build --tag frigate-base --build-arg ARCH=amd64nvidia --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate --file docker/Dockerfile.amd64nvidia . @@ -44,7 +41,7 @@ aarch64_wheels: aarch64_ffmpeg: docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-aarch64 --file docker/Dockerfile.ffmpeg.aarch64 . -aarch64_frigate: version web jsmpeg +aarch64_frigate: version web docker build --tag frigate-base --build-arg ARCH=aarch64 --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate --file docker/Dockerfile.aarch64 . @@ -56,7 +53,7 @@ armv7_wheels: armv7_ffmpeg: docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-armv7 --file docker/Dockerfile.ffmpeg.armv7 . -armv7_frigate: version web jsmpeg +armv7_frigate: version web docker build --tag frigate-base --build-arg ARCH=armv7 --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate --file docker/Dockerfile.armv7 . diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 65cd9d20f..1ff0c5e0b 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -6,7 +6,6 @@ FROM blakeblackshear/frigate-wheels:${WHEELS_VERSION}-${ARCH} as wheels FROM blakeblackshear/frigate-ffmpeg:${FFMPEG_VERSION}-${ARCH} as ffmpeg FROM blakeblackshear/frigate-nginx:${NGINX_VERSION} as nginx FROM frigate-web as web -FROM frigate-jsmpeg as jsmpeg FROM ubuntu:20.04 LABEL maintainer "blakeb@blakeshome.com" @@ -41,7 +40,8 @@ RUN pip3 install \ voluptuous\ Flask-Sockets \ gevent \ - gevent-websocket + gevent-websocket \ + ws4py COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/ @@ -56,9 +56,6 @@ ADD migrations migrations/ COPY --from=web /opt/frigate/build web/ -COPY --from=jsmpeg /opt/build jsmpeg/ -COPY --from=jsmpeg /usr/local/bin/node /usr/local/bin/node - COPY docker/rootfs/ / EXPOSE 5000 diff --git a/docker/Dockerfile.jsmpeg b/docker/Dockerfile.jsmpeg deleted file mode 100644 index 68d5f5afe..000000000 --- a/docker/Dockerfile.jsmpeg +++ /dev/null @@ -1,10 +0,0 @@ -ARG NODE_VERSION=14.16 - -FROM node:${NODE_VERSION} - -WORKDIR /opt/build - -COPY . . - -RUN npm install --no-progress && \ - npm prune --production --ignore-scripts --prefer-offline diff --git a/jsmpeg/.gitignore b/jsmpeg/.gitignore deleted file mode 100644 index b512c09d4..000000000 --- a/jsmpeg/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/jsmpeg/package-lock.json b/jsmpeg/package-lock.json deleted file mode 100644 index 30201bcf0..000000000 --- a/jsmpeg/package-lock.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "jsmpeg", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ws": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.3.tgz", - "integrity": "sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA==" - } - } -} diff --git a/jsmpeg/package.json b/jsmpeg/package.json deleted file mode 100644 index 4e96ee62e..000000000 --- a/jsmpeg/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "jsmpeg", - "version": "1.0.0", - "description": "", - "main": "relay.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "MIT", - "dependencies": { - "ws": "^7.4.3" - } -} diff --git a/jsmpeg/relay.js b/jsmpeg/relay.js deleted file mode 100644 index 8d617c2e7..000000000 --- a/jsmpeg/relay.js +++ /dev/null @@ -1,54 +0,0 @@ -// Use the websocket-relay to serve a raw MPEG-TS over WebSockets. You can use -// ffmpeg to feed the relay. ffmpeg -> websocket-relay -> browser -// Example: -// node relay 8081 8082 -// ffmpeg -i -f mpegts http://localhost:8081/streamName - -var http = require('http'), - WebSocket = require('ws'); - -var STREAM_PORT = process.argv[2] || 8081, - WEBSOCKET_PORT = process.argv[3] || 8082; - -// Websocket Server -var socketServer = new WebSocket.Server({ port: WEBSOCKET_PORT, perMessageDeflate: false }); - -socketServer.on('connection', function (socket, request) { - var streamName = request.url.substr(1).split('/')[0]; - - socket.stream = streamName; - - console.log( - 'New WebSocket connection for: ', - streamName - ); -}); - -socketServer.broadcast = function(data, streamName) { - socketServer.clients.forEach(function each(client) { - if (client.readyState === WebSocket.OPEN && client.stream === streamName) { - client.send(data); - } - }); -}; - -// HTTP Server to accept incoming MPEG-TS Stream from ffmpeg -var streamServer = http.createServer( function(request, response) { - var streamName = request.url.substr(1).split('/')[0]; - - response.connection.setTimeout(0); - console.log( - 'Stream Connected: ', - streamName - ); - request.on('data', function(data){ - socketServer.broadcast(data, streamName); - }); -}) - -// Keep the socket open for streaming -streamServer.headersTimeout = 0; -streamServer.listen(STREAM_PORT); - -console.log('Listening for incoming MPEG-TS Stream on http://127.0.0.1:'+STREAM_PORT+'/'); -console.log('Awaiting WebSocket connections on ws://127.0.0.1:'+WEBSOCKET_PORT+'/'); \ No newline at end of file