This is just my guess. I tried not to post this if there is a positive answer. However, still now, there is no answer. So I'm writing this just to share my opinion. However I'm sorry this is not positive.
If you want just transferring video from iOS devices, it's easy. Just send video file itself. So I assume what you want is live video streaming. Broadcasting what I'm currently recoding.
I did thought about this problem few weeks ago, however I couldn't succeeded. The problem is not a media segmentor. MPEG2 TS is just a container, and segmentation is just splitting video, it cab be implemented easily(?) with accurate specification.
Real problem is video encoding. iOS does not offer compressed live stream from camera input. (maybe yet?) Compressed stream only can be stored into disk. There should be a method to get compressed video stream internally. Because FaceTime is impossible without it. However it does not offered to 3rd parties.
It's possible storing short videos continually and upload them to server. But initiating/completing video session takes too long time. So I gave up this method.
As another way, iOS offers uncompressed video stream, so you can make it by compressing raw video stream yourself. With ffmpeg
or such things. However Apple's video encoding utilizes hardware features to increase performance (this can make video quality better within lower size) and save energy. ffmpeg
does all things only in software. Of course, you can make your hardware-accelerated encoder yourself, or purchase it from some vendor.
There is some live video streaming featured apps on the market. I didn't used them. But maybe one of these.
- transfer raw frames. (no compression or fast but weak compression)
- ffmpeg encoder based.
- independent hardware-accelerated encoder implementation.
First one require too heavy bandwidth, and also consumes heavy energy.
Second one definitely slow and consumes heavy energy. However it may be just enough.
Third one needs too high development cost for small scale apps. But if you have enough budget, this is most fine. I don't about know pre-implemented library for the iOS is exist on the market.
I wish Apple will release this kind of compressed video stream. Which compressed with Apple's hardware accelerated encoder. But maybe it will not happen unless Apple decide to give up protecting high-quality live video streaming feature between devices as their killer feature... the FaceTime.
However it's possible Apple release this API at some time. And I'm not sure that I searched all of APIs. It's possible I couldn't checked something important.
Update
I found the class AVAssetWriter
which can write video data into file with compression. This may be key to making this kind of app.