If you don't encode the raw h264 using x264 or a similar programme, making an mpeg ts from AVCaptureVideoDataOutput is not an easy procedure. Let's suppose for a moment that getting mpeg ts files was simple. Once they were compiled in a m3u8 container, a small web server could be launched to deliver the files. As far as I'm aware, using localhost tunnels from the device is not a major issue, and numerous apps do so. Therefore, while it's possible to create HLs from the gadget, I doubt the results would be good.
Now for method number 2. You capture the frames using AvCaptureVideoDataOutput and then wrap them in a cute little protocol.
Open a socket and deliver the data to your server using json or perhaps something more obscure like bencode. Ah, good luck. You'd better have a strong network because even via WiFi, sending uncompressed frames will consume up bandwidth.
The third technique is next.
You use avassetwriter to create a new movie and use conventional C routines to read it back from the temp file. This works great, but what you have is raw h264 and your mp4 is incomplete, so it lacks any moov atoms. This is where the fun part begins: producing the header. good fortune
Moving on to technique 4, which appears to have some value.
We establish not just one, but two avassetwriters, and we control how they are used by utilising a gcd dispatch queue.
Avassetwriters can only be used once; therefore, we start the first one on a timer, set it for, say, 10 seconds, and then start the second one while dismantling the first. We now have a string of.mov files that each include a complete moov atom and compressed h264 video. The server will now receive these and put them together into a single video feed. We might also use a straightforward streamer that receives mov files, encapsulates them in the rtmp protocol using librtmp, and sends them to a media server.
That question has been misread several times, but could we simply send each individual MOV file to another Apple device to enable device-to-device communication?
It is feasible and relatively simple to connect devices on the same subnet using wifi. Finding another device through a cellular connection is practically impossible; if it is possible at all, it can only be done on cell networks that employ addressable ip addresses, which not all popular carriers do.
Even if you could, there would still be a problem because none of the avfoundation video players could manage switching between that many different separate movie files. It would be necessary for you to create your own streaming player, most likely based on ffmpeg decoding. (That actually functions rather nicely)