1

What seemed to be an easy job turned out otherwise. I wanted to write an Electron app to manage DVR streams as I wasn't satisfied with some apps I used. I choose Electron because I recently started JS and took the opportunity to practice it and also play a bit with Electron.

After deciding about how to handle GUI using web components, it was time to see how to read RTSP streams. My initial approach was to use FFmpeg. But I didn't know how to do so in Nodejs or Electron so I started a research.

Long story short I understood that if one wants to use a C/C++ library in JS the best practice is to create bindings using Node API (formerly NAPI) which will result in a FFmpeg native addon. Then I assumed there is already a decent such addon available as FFmpeg is the go-to for video stuff. But to my surprise this isn't the case. Although there are some packages which run ffmpeg executive binary the ones that provide the binding are rare and not recent (such as beamcoder).

FFmpeg web assembly is another option which I may consider but seemed overkill as I am not opening the streams in pure browser.

Another approach was to use chromium media abilities as it has FFmpeg bundled for some media functions but to my understanding it cannot open RTSP streams at least for now.

Can you please add to my current understanding on the matter?

Siavoshkc
  • 346
  • 2
  • 16

0 Answers0