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.95k stars 1.52k forks source link

Record all streams - Important #420

Open abresihjj opened 3 years ago

abresihjj commented 3 years ago

Hello dear friends I want it to start recording whenever the stream starts and save it in a folder

From

      {
        app: 'live',
        mp4: true,
        mp4Flags: '[movflags=frag_keyframe+empty_moov]',
      }

I used it but nothing was stored anywhere? Where is it stored? Records all streams?

Please help It is very important and necessary and I think it is a question of many

Thanks Please reply

nguyenminhan commented 3 years ago

too me!

bikash-s-bhandari commented 2 years ago

it get stored on mediaroot in ur http http: { port: 8888, mediaroot: './server/media', allow_origin: '*' },

BBQ-zhu commented 2 years ago

前提是你得安装好ffmpeg,它才是录制工具,应该去官网下载,然后放入到项目中,配置处修改好正确路径

sylvesterroos commented 2 years ago

it get stored on mediaroot in ur http http: { port: 8888, mediaroot: './server/media', allow_origin: '*' },

I can't find this folder anywhere. Can you elaborate a bit on this? Is it a setting I need to enable?

siddhantranjan commented 1 year ago

so lets say your folder structure is like /src/config where config contains a file for node-media-server config file so ./server/media will be like this '/src/server/medi' don't forget "./"

kkm commented 1 year ago

I confirm it works fine. App name you have the same as rtmp for example: rtmp://localhost/live_stream. that would set app live_stream and mediaroot correctly.

const config = {
  logType: 3, // 0=keine Log, 1=Error, 2=Error+Info, 3=alles
  rtmp: {
    port: 1980,
    chunk_size: 60000,
    gop_cache: true,
    ping: 30,
    ping_timeout: 180
  },
  http: {
    port: 8010,
    allow_origin: '*',
    mediaroot: './media',
  },
  trans: {
    ffmpeg: '/usr/bin/ffmpeg',
    tasks: [
      {
        app: 'live_stream',
        mp4: true,
        mp4Flags: '[movflags=frag_keyframe+empty_moov]',
      }
    ]
  }
};