Rather difficult to do ...
I am trying to transfer video (H264) over a network on iOS. However, I receive video data to the buffer through an open socket to a remote server (using CocoaAsyncSocket), so I donβt have a URL for the video that I can use to create AVAsset or MPMoviePlayer. The video is a real-time stream, so the data will just continue (i.e. there is no set duration) if that matters.
I need to do this like a server is an RTSP server. I wrote my own RTSP client to send commands and get responses, and now I'm trying to do something useful with the video data that comes through the connection.
Any ideas on how I can play this video? The only thing I can think about at the moment is to somehow save the file and load it (but I donβt see how it will work, since I will constantly upload new data), or resorting to doing it manually somehow with something like ffmpeg. And no, unfortunately, I canβt get the server to do HTTP Live Streaming.
Any help would be greatly appreciated!
source share