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

NSPratik picture NSPratik · Jul 4, 2016 · Viewed 63.2k times · Source

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.

Answer

niutech picture niutech · Jun 12, 2017

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.