'Can't stream video when using node-rtsp-stream latest version?

I am using node-rtsp-stream latest version (0.0.9)

https://www.npmjs.com/package/node-rtsp-stream

I use it (node-rtsp-stream) to stream an IP camera. I also install the latest version of ffmpeg here:

https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z

Here is my code

Stream = require('node-rtsp-stream');
stream = new Stream({
  name: 'test',
  streamUrl: 'rtsp://username:password@IP:PORT/cam/realmonitor?channel=1&subtype=0',
  wsPort: 9999,
  ffmpegOptions: { // options ffmpeg flags
    '-r': 30 // options with required values specify the value after the key
  }
});

After running nodejs server I get the following output:

Metadata:
    title           : Media Server
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuv420p(tv), 2688x1520, 25 tbr, 90k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'pipe:':
  Metadata:
    title           : Media Server
    encoder         : Lavf59.20.101
  Stream #0:0: Video: mpeg1video, yuv420p, 2688x1520, q=2-31, 200 kb/s, 30 fps, 90k tbn
    Metadata:
      encoder         : Lavc59.25.100 mpeg1video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

This result means I can't stream video from the camera yet. Output is empty, whereas if I use 0.04 version, I can streamming the videos. Below is output if I using node-rtsp-stream version 0.0.4:

Metadata:
    title           : Media Server
  Duration: N/A, start: 0.040000, bitrate: N/A
  Stream #0:0: Video: hevc (Main), yuv420p(tv), 2688x1520, 25 fps, 25 tbr, 90k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
Output #0, mpeg1video, to 'pipe:':
  Metadata:
    title           : Media Server
    encoder         : Lavf59.20.101
  Stream #0:0: Video: mpeg1video, yuv420p(tv, progressive), 2688x1520, q=2-31, 200 kb/s, 30 fps, 30 tbn
    Metadata:
      encoder         : Lavc59.25.100 mpeg1video
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=  314 fps= 32 q=24.8 size=    4768kB time=00:00:10.40 bitrate=3755.7kbits/s dup=51 drop=0 speed=1.05x 

But I need to use the latest version (node-rtsp-stream 0.0.9) for my project, please take a look.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source