IOS Live streaming - nsurlprotocol

Problem:
I need to download mp4 video from media server and simultaneously feed the localhost httpserver (GCDWebServer) to enable video streaming.
What have i tried so far:
I am able to download a video file from media server and then provide the localhost url for streaming the video.
But this takes a lot of time in downloading. So i wanted to know if there is a way i can segment the video on the fly and keep updating the m3u8 file as and when my next segment is ready.
Ok, Why downloading? Basically i need to deal with a custom encrypted video file. So i need to download, then decrypt the stream and then feed to my local httpserver.
I hope i'm clear in the requirements.

Related

Swift: How to play the video and download at the same time

Currently in our iOS Application, we are downloading the video and then playing it, which is indeed taking a lot of time and killing the user experience. Now, we want to shift to directly stream the video or play the video while it is downloading.
I have tried using AVAssetResourceLoaderDelegate. I doesn't play the video at all and displays the mime type as text/html. Maybe because I am loading from a secured URL with headers.
Can someone suggest me a good way where I can stream or Play the video while downloading it. Would be glad if someone suggest a way to Stream the video's directly from the URL.

Fast uploading video and play without buffering video from URL

In my Application I'm capturing 10 second of video and upload to server by FTP and Other user can watch this video by URL(s) from web service response.
As per my question I want to capture video with good quality with small size so It easy to upload video by FTP. Right now I'm using .mp4 video formate to upload video if anybody know best video formation that can increase uploading speed then guide me.
Second I'm getting all those uploaded video in the response of web service as a URL(s).
In response there are many URLs so I need to play video in queue means one-by-one and end user can do swipe left to move on NEXT video and swipe RIGHT to previous video. You can see my code here.
Every thing is working good but problem is take much time to upload and play (buffering time) video.
Please guide me on this points.
COMMENT : Get success in the compress video 20 MB to 1.6 MB so uploading speed bit increase and Right now working with AVQueuePlayer for play video in queue but some time stuck video to playing.
Yes,
May you upload video using chunk data in base64 format.
This is faster then FTP video upload & also useful when your internet connection is lost same time when you upload video in sequence.
You can upload your files via SFTP, it is speed than FTP I think. Also your videos may bad performance with plays on http protocol.
You should follow this lines, I hope it will help you;
Upload video via SFTP or Amazon S3
Install to your server a stream engine like Wowza or Red5
Transcode video for mobile (Usually wowza makes auto)
Stream your videos over rtsp for android, hls (http) for ios
That its!
Good luck

iOS play video as downloaded data

I am downloading a video from remote server. while download in progress what ever data downloaded in current(not full download), I want to play that data in a video player. if the file size is 10 MB, when I start download if 0.5 Mb downloaded I want to play that 0.5MB video, while downloading It has to play. I dont' want to stream, because next time I can play it from local file.
is there any video player available in iOS?.
Whatever you are asking for is called a progressive download, which is performed over HTTP protocol (RTSP is for streaming) and HTTP server is required (instead of Streaming server).
You can play the progressive download streaming from a simple java server https://github.com/mooncatventures-group/StreamX
iOS devices support HTTP progressive download for .mp4 files..

Stream only audio track from mp4 file

I have a remote MP4 file that has video and sound. I want to only stream the audio track of the mp4 file. I don't need the video and want to decrease the internet usage in my app. I have no idea where to start with this, Google doesn't seem to help. Is this impossible? Any ideas?
You can't... If you want audio only, you need to split video / audio on the server or put a stream software (like vlc, ffmpeg or mplayer) who can re-encode file in realtime (so you can drop video for new stream)
It's better, for me, to process all files on server and extract audio track...

Play the Video/Audio which is getting from the server

Is there any solution of this below one?
I have the Video/audio URLs
My Requirement is:
Is it possible to get the video/audio from the server and at the same time I have to open the player to play it(Like showing the Live-video directly in browser Field).
Means
Getting streaming into a buffer in back-end and at the same time I want to show it in the player.
If above is possible
I want to save that particular video/audio streaming data in to one file.
This blackberry KB link explains about streaming video from server. It may help you.

Resources