How to parse a M3U8 file in Objective-C?

I am trying to save .ts segments to disk from an HLS stream to achieve recording functionality. After passing Record an HTTP streaming video to a file while watching? and Save the HLS stream to iPhone / iPad for output, to save the files to disk and configure the server locally and transfer it from there. I'm having trouble parsing the M3U8 file. Found M3U8Kit , but not what I was looking for. Can someone point me in the right direction how to parse the M3U8 file? It looks something like this.

#EXTM3U 

#EXT-X-TARGETDURATION:10

 #EXT-X-MEDIA-SEQUENCE:1 #EXTINF:10, http://media.example.com/segment0.ts #EXTINF:10, http://media.example.com/segment1.ts #EXTINF:10, http://media.example.com/segment2.ts #EXT-X-ENDLIST 
+6
source share
2 answers

Also for those who might need it, M3U8Paser is an extended M3U8Kit library for parsing the m3u8 file to get links for several m3u8 files used for adaptive streaming

+8
source

I know this is an old question, but open source, MIT Licensed, Pantomime can meet your needs.

0
source

Source: https://habr.com/ru/post/946646/


All Articles