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

where is the rmtp (m3u8) output file generated? #71

Open laurencefass opened 6 years ago

laurencefass commented 6 years ago

I have set up a working demo and I wish to consume the m3u8 file. Problem is i cant locate it and the URLs on github arent giving me anything....

I'm working to the most basic example...

server.js

const NodeMediaServer = require('node-media-server');

const config = {
  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: true,
    ping: 60,
    ping_timeout: 30
  },
  http: {
    port: 8000,
    allow_origin: '*'
  }
};

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

i've installed this server into a docker container and ive set up OBS

Stream Type : Custom Streaming Server
URL : rtmp://ip-address/live
Stream key : test

I can access the stream with VLC player at rtmp://ip-address/live/test.

and i can see this output from the server in the container

[2018-4-12 13:25:29 [INFO] [rtmp publish] New stream. id=DEQZIPAE streamPath=/live/test streamId=1
2018-4-12 13:25:29 [INFO] [rtmp publish] Handle audio. id=DEQZIPAE streamPath=/live/test sound_format=10 sound_type=2 sound_size=1 sound_rate=3 codec_name=AAC 44100 2ch
2018-4-12 13:25:29 [INFO] [rtmp publish] Handle video. id=DEQZIPAE streamPath=/live/test frame_type=1 codec_id=7 codec_name=H264 640x360
2018-4-12 13:27:53 [INFO] [rtmp connect] id=K41G2HQ4 ip=192.168.1.3 app=live args={"app":"live","type":"nonprivate","flashVer":"FMLE/3.0 (compatible; FMSc/1.0)","swfUrl":"rmtp://192.168.1.5/live","tcUrl":"rmtp://192.168.1.5/live"}](url)

Problem

i want to access rmtp output files (m3u8) on the media server so i can display in a browser. I have no access to http://ip-address:8000/live/test/index.m3u8. where is the rmtp output configuration in node js code mapping to a linux directory?

...is it configurable?

thanks

illuspas commented 6 years ago

FFmpeg and 'trans' configuration block are required.

laurencefass commented 6 years ago

thanks i have updated server.js to the code below but i still have no m3u8 output at http://ip-address:8000/live/test/index.m3u8.

should this work? or do i need to install anything extra in the image?

const NodeMediaServer = require('node-media-server');

const config = {
  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: true,
    ping: 60,
    ping_timeout: 30
  },
  http: {
    port: 8000,
    mediaroot: './media',
    allow_origin: '*'
  },
  trans: {
    ffmpeg: '/usr/local/bin/ffmpeg',
    tasks: [
      {
        app: 'live',
        ac: 'aac',
        hls: 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]'
      }
    ]
  }
};

var nms = new NodeMediaServer(config)
nms.run();
laurencefass commented 6 years ago

will the server.js above output both files?

http://localhost:8000/live/STREAM_NAME/index.m3u8 http://localhost:8000/live/STREAM_NAME/index.mpd

if so, is there a way to switch one off if it is redundant?

what is the physical location of the rmtp output files?

RajanZhan commented 6 years ago

have you solved this problem? I met same problem ,could you tell me how to solve this problem,I will really appreciate it.

Shion093 commented 6 years ago

yes a have the same problem, i'm running this on mac os and ffmpeg is installed in this path

'/usr/local/Cellar/ffmpeg/4.0.2/bin/ffmpeg'

t1amat9409 commented 5 years ago

I'm also looking for the recorded files and other streams related files, can't seem to find them

FilipLukac commented 5 years ago

Same problem here