illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.89k stars 1.51k forks source link

flv file is not present in my live folder #622

Closed harrymelka closed 5 months ago

harrymelka commented 6 months ago

Hello

How do you configure the ws, it's the flv file that is created when you launch the stream but I don't manage to get it.

This is my config:

const config = {
  logType: 3,

  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: true,
    ping: 30,
    ping_timeout: 60,
  },
  http: {
    port: 8080,
    mediaroot: "./media",
    allow_origin: "*",
    api: true,
  },
  trans: {
    ffmpeg: "/usr/bin/ffmpeg",
    tasks: [
      {
        app: "live",
        hls: true,
        rtmp:true,
        hlsFlags: "[hls_time=2:hls_list_size=3:hls_flags=delete_segments]",
        dash: true,
        dashFlags: "[f=dash:window_size=3:extra_window_size=5]",
        'websocket-flv': true, // Not working
      },
    ],
  },
};

var nms = new NodeMediaServer(config);
nms.run();

With that you get the flv or do I need to use ffmpeg in the config ?

I saw this

You can use ffmpeg to re-push.

ffmepg -re -i FLV -c copy -f flv rtmp://server-ip/live/stream

Then you can access through ws://server-ip:8000/live/stream.flv

Where should I insert that ?

With that I should be able to support more concurrent watcher in the same stream right ?

Thanks