1 Reply
      Latest reply on Oct 28, 2017 11:42 AM by sw_mechanic
      flute-loop Level 1 Level 1 (0 points)

        Hello,

        I'm using HLS to create "unique" videos:

        - I have a stock of video sequences (segments)

        - I build a playlist dynamically (based on user's inputs)

         

        My segments are video-only 4 seconds ffmpeg-encoded .mp4 files, mp4box-prepared.

        I declare #EXT-X-DISCONTINUITY between each segment

         

        The audio is "separated" (#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio"...)

        I chunked the audio to make its playlist "discontinued" as well, so that the video discontinuity matches the audio discontinuity.

         

        My problem is:

        (EDIT:) in HTML environment on Safari, on both MacOS and iOS.

        I get a short audio mute (about 0.2 seconds) on each discontinuity.

        (I also tried 3.84 seconds of 25fps video + 48kHz audio, but maybe I didn't do it properly ?)

         

        My question is:

        is it possible to have NO audio mute (at all) on discontinuity, or is it "decided" (that a gap will be inserted) to prevent audio glinchs ?

        If not, how can I get a seamless output stream ?

        • Re: HLS audio gets shortly muted on discontinuity
          sw_mechanic Apple Staff Apple Staff (65 points)

          A discontinuity tells the system to reconstruct the rendering chain. As far as I undersand it this will cause a "gap". I'm not certain whether 200ms is the amount, but that sounds plausible, (Based on further conversations with other engineers it seems you should be able to have no gap.) You are correct that you have to have discontinuities in the audio as well. Otherwise bad things will happen.

           

          I get the sense that you audio is really continuous (such as a song). One idea for how you might avoid the gap is to play two separate streams and sync them using the technique described in this year's Advances in HTTP Live Streaming WWDC talk. Under the Resources section on that page there is a link to sample code. This requires that you play using your own app, since you have to sync up two separate AVPlayers.


          Feel free to put in a Radar or a DTS request about the gap. It may be that someone with more low-level experience than me can provide some advice.


          Please put in a radar with a sample stream so we can help you get to the bottom of this issue.