kyriesent / node-rtsp-stream

Stream any RTSP stream and output to websocket for consumption by jsmpeg (https://github.com/phoboslab/jsmpeg). HTML5 streaming video! Requires ffmpeg.
MIT License
451 stars 166 forks source link

Creating Dockerfile for project #57

Closed yumna4 closed 4 years ago

yumna4 commented 4 years ago

Hi, I want to create a Dockerfile for the server side.

I have the following in the rtsp-server.js file

`Stream = require('node-rtsp-stream') stream = new Stream({ "name": 'name', "streamUrl": 'rtsp://user:pass@xxx.xx.xx.xx:xxx', "wsPort": 8082,

"ffmpegOptions": { // options ffmpeg flags

  '-stats': '', // an option with no neccessary value uses a blank string
  '-r': 30, // options with required values specify the value after the key

} })`

And in the Dockerfile, I have the following

FROM node:latest RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY . /usr/src/app/ RUN apt-get update && apt-get -y install ffmpeg RUN npm install CMD node rtsp-server.js

This is the output I get in the console when I build and run the docker image.

libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [rtsp @ 0x55b11cf73ec0] UDP timeout, retrying with TCP [rtsp @ 0x55b11cf73ec0] method PAUSE failed: 551 Option not supported [rtsp @ 0x55b11cf73ec0] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, rtsp, from 'rtsp://user:pass@xxxxxxxxxxx': Metadata: title : Media Presentation Duration: N/A, bitrate: N/A Stream #0:0: Video: h264, none, 90k tbr, 90k tbn, 180k tbc Output #0, mpegts, to 'pipe:': Output file #0 does not contain any stream

Kavyeshs41 commented 4 years ago

For the sake of simplicity I've created a docker image. you can use it directly.

more details in description of docker hub.

https://hub.docker.com/r/kavyesh/node-rtsp-ws

kyriesent commented 4 years ago

@Kavyeshs41 wow thank you! This is great!