Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS/m3u8 target duration unstable #596

Open
hankthetank27 opened this issue Jun 28, 2023 · 0 comments
Open

HLS/m3u8 target duration unstable #596

hankthetank27 opened this issue Jun 28, 2023 · 0 comments

Comments

@hankthetank27
Copy link

I've recently been experiencing an issue where my the TARGETDURATION property on my index.m3u8 playlist changes quite dramatically at infrequent but seemingly random times. My application as a single infinitely running HLS stream which has audio files piped into into it sequentially, like a radio broadcast. In my NMS config file, I have my HLS time set to 3 seconds, but occasionally will jump up to large values over 3000 seconds at times, causing the stream to go silent (often these values are longer than a single song itself). I'm having a lot of trouble diagnosing if this a bug in NMS itself. I'm not very well versed on how HLS works, and after some research have not been able to determine if this is normal behavior, although it seems like it wouldn't be. Below is my NMS config file:

  const config = {
    logType: 3,
    rtmp: {
      port: 1935,
      chunk_size: 60000,
      gop_cache: false,
      ping: 60,
      ping_timeout: 120
    },
    http: {
      port: 8000,
      mediaroot: './media',
      allow_origin: '*'
    },
    trans: {
      ffmpeg: ffmpegPath,
      tasks: [
        {
          app: 'live',
          vc: "copy",
          vcParam: [],
          ac: "aac",
          acParam: ['-ab', '128k', '-ac', '2', '-ar', '44100'],
          rtmp:true,
          rtmpApp:'live2',
          hls: true,
          hlsFlags: '[hls_time=3:hls_list_size=4:hls_flags=delete_segments]',
          hlsKeep: false
        }
      ]
    },
    mediaServer: {
      idleTimeout: 30
    },
  };

And here is an example of an m3u8 file with the correct target duration vs one that is incorrect...

correct:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:3
#EXT-X-MEDIA-SEQUENCE:2296
#EXTINF:3.018889,
index2296.ts
#EXTINF:2.995667,
index2297.ts
#EXTINF:2.995667,
index2298.ts
#EXTINF:2.995667,
index2299.ts

incorrect:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:3072
#EXT-X-MEDIA-SEQUENCE:56864
#EXTINF:0.023222,
index56864.ts
#EXTINF:1944.791444,
index56865.ts
#EXTINF:3072.300000,
index56866.ts
#EXTINF:3072.300000,
index56867.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant