Skip to content

Electron application without FFMpeg #77

@erikmartinjordan

Description

@erikmartinjordan

I'm building an Electron application, which launches an Express server in the background and sends back a stream as a response.

Sample code:

const express = require('express');
Stream        = require('node-rtsp-stream');

let app = express();

let server = app.listen(3000);

app.get('/video', function(req, res){
    
    stream = new Stream({
        
        name: 'name',
        streamUrl: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov',
        wsPort: 9000
        
    });
   
    res.send(
        `<!DOCTYPE html>
            <html>
            <head>
                <meta name = "viewport" content = "width=640, initial-scale=1"/>
                <style type = "text/css">
                    html, body {
                        width: 800px;
                        height: 600px;
                        margin: 0;
                    }
                    canvas {
                        margin: 0;
                    }
                </style>
            </head>
            <body>
                <canvas id = "video"></canvas>
                <script src = "https://cdnjs.cloudflare.com/ajax/libs/jsmpeg/0.2/jsmpg.js"></script>
                <script>
                    var client = new WebSocket( 'ws://localhost:9000/' );
                    var canvas = document.getElementById('video');
                    var player = new jsmpeg(client, {canvas: canvas});
                </script>
            </body>
            </html>`
    );
    
});

It seems that node-rtsp-stream isn't creating the WebSocket and sending the stream. I guess it's failing because FFMpeg isn't installed on the server.

The problem is that it's a client application and I don't have control if the user has FFMpeg installed on his computer.

Is there a way to make node-rtsp-stream work? Can I force the application to install FFMpeg in some way? Can I combine ffmpeg Node.js package to make it work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions