npm.io
1.0.1 • Published 6 years ago

rtmp-stream

Licence
ISC
Version
1.0.1
Deps
0
Size
14 kB
Vulns
0
Weekly
0

Node-RTMP-Stream

Listen to RTMP stream and convert to MPEG-TS

Requirements

FFMPEG

const rtmp = new RTMP({
  FFMPEG: 'path to ffmpeg binary',
  RTMP_INPUT : 'tcp://localhost:9090', //Your streaming server will publish to this address
  RTMP_OUTPUT: 'tcp://localhost:9191', //Stream is converted and will be sent to this unix socket
})
rtmp.RTMPInput()
rtmp.RTMPOutput()

rtmp.RTMPInput()
rtmp.RTMPOutput()

rtmp.ffmpeg.on('stdout', () => {
  console.log("Started to convert")
})


rtmp.output.on('media-data', (data) => {
  console.log("Getting MPEG data:", data)
})

// There are other events fired from rtmp.output and rtmp.ffmpeg. See the code for more info