Search code examples
ioshttp-live-streamingm3u8m3u

How to download and decrypt HTTP Live Streaming (HLS) videos in iOS?


I want to download M3U8 file chunks (HLS) and store that video (after decrypting it) for later viewing. I have made a demo to play M3U8 file but I want to download video data for later view.


Solution

  • You can use ffmpeg to download and decode the HTTP-LS stream:

    ffmpeg -i http://example.org/playlist.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4
    

    There is an iOS version of ffmpeg available.