In an effort to extract the raw CMSampleBufferRef from a HLS Live Stream (for re-encoding the video), I'm trying to use AVAssetReader to read the HLS stream (.m3u8 file). Since reading from network stream directly is not supported by AVAssetReader, I'm trying to download the .ts files listed in the HLS m3u8 index file to the local drive first, then read it back using AVAssetReader. However, when I tried opening the .ts file with AVAssetReader, I'm getting the error "This media format is not supported" (Error Domain=AVFoundationErrorDomain Code=-11828 "Cannot Open" UserInfo=0x7fd3aa723570 {NSLocalizedFailureReason=This media format is not supported).
Does anyone know if AVAssetReader supports reading .ts (mpeg2 transport stream) from local drive? If not, is there any other way to create/extract CMSampleBufferRef from a HLS stream? Thanks!