Playing a .TS file on iOS
- by Jonathan Grynspan
We're working with some hardware that produces files in the .TS format, and we'd like to play them on an iOS device. (The files are internally consistent with what iOS supports--MPEG-4 video, AAC audio.)
We've been investigating three options so far:
Roll our own integrated HTTP Live Streaming server and serve up a faux M3U8 playlist from within the app. This... doesn't seem to want to play nice, and we've had mixed luck actually getting the .TS files to play on devices.
Unwrap the MPEG-4 and AAC data from the TS file and re-wrap it as MP4. This, I'm told, is exceedingly difficult to do, and I haven't found anything useful online that could shed light on how to do it. We've got code in the pipeline to do it but it won't be ready until long after we need it. If we could do it, I could easily subclass NSURLProtocol and have it working within a matter of hours minutes.
Use FFmpeg to implement option #2. FFmpeg seems like a possible solution but it isn't configured to build for iOS and I don't have the background to get it working (whereas the rest of our engineers don't have the Apple background needed.)
I think #2 is our best bet, but as I don't know the ins and outs of MPEG-2 TS and MPEG-4, I don't have the ability to put it together myself.
Does anybody have any insight into this problem? Perhaps some experience playing local TS files on iOS, or some tips on converting from TS to MP4?