GithubHelp home page GithubHelp logo

chiehwen / node-rtsp-rtmp-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iizukanao/node-rtsp-rtmp-server

0.0 2.0 0.0 782 KB

RTSP, RTMP, and HTTP server implementation in Node.js

License: MIT License

node-rtsp-rtmp-server's Introduction

RTSP, RTMP, and HTTP server in Node.js

  • Supports RTSP, RTMP/RTMPE/RTMPT/RTMPTE, and HTTP.
  • Supports only H.264 video and AAC audio.
  • Supports only a single pair of audio/video streams.

Installation

$ git clone https://github.com/iizukanao/node-rtsp-rtmp-server.git
$ cd node-rtsp-rtmp-server
$ npm install -d

Configuration

Edit config.coffee.

Starting the server

$ cd node-rtsp-rtmp-server
$ sudo coffee server.coffee

or use Node.js directly:

$ cd node-rtsp-rtmp-server
$ coffee -c .
$ sudo node server.js

If serverPort is above 1023 in config.coffee, you can omit sudo.

Publishing streams

From Flash Media Live Encoder

Flash Media Live Encoder is a free live encoder from Adobe.

In the Encoding Options panel, check "Stream to Flash Media Server" and set the URL to:

  • FMS URL: rtmp://localhost/live
  • Backup URL: (blank)
  • Stream: myStream (or whatever you like)

Press the "Connect" button. Set the video format to H.264, and the audio format to AAC. Press the "Start" button.

Note that multiple streams are not supported. You can push only one stream at a time.

From FFmpeg

If you have an MP4 file with H.264 video and AAC audio:

$ ffmpeg -re -i input.mp4 -c:v copy -c:a copy -f flv rtmp://localhost/live/myStream

Or if you have an MP4 file that contains other audio/video codecs:

$ ffmpeg -re -i input.mp4 -c:v libx264 -preset fast -c:a libfdk_aac -ab 128k -ar 44100 -f flv rtmp://localhost/live/myStream

Replace input.mp4 with live audio/video sources.

From GStreamer

For an MP4 file with H.264 video and AAC audio:

$ gst-launch-0.10 filesrc location=input.mp4 ! qtdemux name=demux ! \
    flvmux name=mux streamable=true ! queue ! \
    rtmpsink location='rtmp://localhost/live/myStream' demux. ! \
    multiqueue name=mq ! h264parse ! mux. demux. ! mq. mq. ! aacparse ! mux.

Replace input.mp4 with live audio/video sources.

Accessing the live stream

Via RTSP

RTSP stream is for VLC media player or Android's VideoView.

RTSP URL: rtsp://localhost:80/live

Note that the RTSP server runs on port 80 by default.

Via RTMP

RTMP stream is for Flash Player. Flowplayer and JW Player are both good free players.

RTMP URL: rtmp://localhost/live/myStream

If you have rtmpdump installed, you can record the video with:

$ rtmpdump -v -r rtmp://localhost/live/myStream -o dump.flv

node-rtsp-rtmp-server's People

Contributors

iizukanao avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.