I've setup node media server for a streaming application it is working fine until it is streaming live but whenever the streamed video is played again it just plays last few chunks I think it is notwriting index.m3u8 file completely or deleting first chunks from file only. I can see files for these chunks in my storage folder.
Lets say video has chunks from index0.ts to index40.ts but in index.m3u8 file it only has index35.ts to index40.ts.
Here is my nms.config.js
export default {
server: {
port: 8026,
},
auth: {
api: true,
api_user: 'admin',
api_pass: 'admin',
},
rtmp: {
port: 1935,
chunk_size: 60000,
gop_cache: true,
ping: 60,
ping_timeout: 30,
},
ssl: {
port: 443,
key: '/etc/letsencrypt/live/live.app/privkey.pem',
cert: '/etc/letsencrypt/live/live.app/fullchain.pem',
},
http: {
api: true,
secret: 'kjVkuti2xAyF3JGCzSZTk0YWM5JhI9mgQW4rytXc',
port: 8020,
mediaroot: '/home/stream/src/storage',
allow_origin: '*',
},
https: {
api: true,
key: '/etc/letsencrypt/live/live.app/privkey.pem',
cert: '/etc/letsencrypt/live/live.app/fullchain.pem',
},
static: {
root: '/home/stream/src/storage',
serve: '/ddf',
cacheControl: true,
dotfiles: 'ignore',
etag: true,
index: false,
lastModified: true,
maxAge: 0
},
trans: {
ffmpeg: '/usr/bin/ffmpeg',
tasks: [
{
app: 'live',
mp4: true,
mp4Flags: '[movflags=frag_keyframe+empty_moov]',
hls: true,
hlsKeep:true,
hlsFlags: '[segment_time=5,segment_list_flags=live,hls_list_size=0]',
mediaroot: "/home/stream/src/storage"
},
],
},
relay: {
ffmpeg: '/usr/bin/ffmpeg',
tasks: [],
},
};
I am expecting nms normal configuration to handle this let me know if I am missing something. Any help or suggestion would be appreciated.