I set up my Raspberry Pi Zero W to stream video using this tutorial on how to implement RPi-Cam-Web-Interface.
I then set up the Pi to be an access point so that I could connect my Pi to my iPhone and watch the video using this tutorial:
I then created a simple iOS app that uses MJPEGStreamLib to play the feed. (I had tried several other methods as well but this is what I finally landed on.)
MJPEGStreamLib can be found here: https://cocoapods.org/pods/MJPEGStreamLib
If I connect my Macbook pro to the Pi and watch the MJPEG stream it works really well. I am using the out of the box HTML page to view the stream from RPi-Cam-Web-Interface that streams MJPEG video.
However, on my iPhone the video will freeze quite frequently and the console reads that it failed to connect to host. Then it will go back to streaming.
For my purposes I need this stream to be very low latency. The Macbook acheives this and the phone achieves this as well... just when its not freezing.
The freezing it appears to not have to do with the video size or the FPS as it happens roughly the same amount with high or low quality video.
I am wondering why this would work perfectly fine on the Macbook and not on the iPhone and what I can do about it.
After a lot of research I'm not quite sure how to remedy the issue and I have a lot of questions.
Are there settings that I can change on the PI to fix this? I tried doing the following
sudo iwconfig wlan0 frag 512 sudo iwconfig wlan0 rts 250
And I think it got a little better... but I am not sure.
Is the problem interference being that I'm in a place with a ton of different wifi signals going on? If so how do I resolve that?
Do I need to switch channels? I have it set on channel 7
Would there be a difference switching from 2.4 to 5 GHz?
Is it better to get an external wifi dongle that has more power for the Pi?
Is this even the optimal setup for how to go about this? Is there a better way to stream medium to high quality video to an iPhone via wifi?
Any help would be appreciated. Thanks.