HLS update

HLS module has been updated recently. Muxdelay parameter has been introduced to escape problems with audio. I’ve encountered a case when (audio) sample PTS was less than current PCR which caused choppy audio. After the fix it’s now OK. Sample PTS are always ahead of PCR. The config setting is hls_muxdelay with default value of 700ms. The same setting with the same default exists in ffmpeg.

Advertisements
  1. #1 by Vineet Goel on September 5, 2012 - 11:08 am

    Wanted to ask you this, don’t know if commenting is right place to do.
    How does “hls on” and “live on” go together?
    Can you plz also elaborate on the latest ffmpeg commit which make “hls” submodule redundant

    Many Thanks

    • #2 by rarut on September 5, 2012 - 6:18 pm

      1) “hls on” and “live on” are absolutely unrelated and can go together or apart.

      2) I didn’t analyze the patch itself, but it should be simple. We’ve done that with bash script few weeks ago (with the old ffmpeg segmenter) and it worked perfectly with iPhone. It’s only about 2 lines in m3u8 file.

      Now you can use exec command to run ffmpeg … -f segment … to automatically generate HLS from RTMP with the new ffmpeg.

      However there’s a couple of issues about the segmenter. It calls write_header/write_tail on each segment restart. That causes MPEG-TS stream discontinuities which can be discovered with ffplay. The good news is iPhone does not care about that.

      Another issue is ffmpeg does not delete the old segments. It’s on you to delete them.

      • #3 by Vineet Goel on September 6, 2012 - 4:48 am

        Thanks. So no need to compile the hls module anymore. We can use the exec command with segment option.
        I was curious to know your thoughts on one more issue.
        As you know, HLS playlist could either be a “live event” or “VOD”. If we gonna use ffmpeg to generate the m3u8 playlist, that means every new user connecting to the stream will alwasy start from the first segment as listed in the playlist file. I understand that the playlist ENDTAG will be generated after stream is finished.
        But how do we achieve a “sliding window” effect with HLS stream to make people jump into latest segement and continue from there itself.
        There are couple more interesting questions I have if you would like to discuss

        Thanks again

      • #4 by vineet156 on October 9, 2012 - 9:38 am

        I thought “hls on” would work whenever a “live” stream is published to generate respective live hls playlist and segments.
        similar to having an exec on publish. I personally like hls submodule method better than having to exec ffmpeg binary

        if not then what does “hls on” will do in other than “live” publish cases

        Thanks

      • #5 by rarut on October 9, 2012 - 10:03 am

        It’s not about receiving live stream.
        ‘live on’ toggles stream retransmission to subscribers.
        ‘hls on’ toggles hls playlist & fragment generation.

        ‘hls on’ without ‘live on’ means ‘receive stream from publisher and create hls playlist/fragment but not send stream to subscribers’

      • #6 by Sergey on November 10, 2012 - 3:11 am

        Is it possible to publish rtmp or hls live stream from user webcam to server and broadcast live hls?

  2. #7 by DeweyOx on October 7, 2012 - 8:15 pm

    Question, are all the Notify directives available for a HLS stream?

    • #8 by rarut on October 8, 2012 - 11:58 am

      Notification have nothing to do with HLS. HLS is just output module. Notifications work with live streams.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: