Progressive download and Caching - ios

I want to play the video from remote server as well as cache it locally on ipad so that next time if it is present I can play it offline also.
Does anybody had done this before? I guess progressive download is one of the option but need to understand where it get saved and can i back up these over the icloud?

In this first example I play the progressive download streaming from a simple java server
https://github.com/mooncatventures-group/StreamX
http://www.youtube.com/watch?v=Rdb0eKhmH4Q
then there's this one taking a stream, in case rtsp and use alassetwriter
https://github.com/mooncatventures-group/FFPlayer-beta1/blob/master/FFAVFrames-test/ViewController.m

Related

Architecture for a web app to add overlays to users' Youtube live stream video?

I am trying to build a web app for users to easily add text (as open caption) and other assets in my app as overlays in real-time to their YouTube live stream video.
They will use their camera to record their video, and select from my app which text should be added to the video.
Then, the video will be sent to Youtube live through their API.
Here are my questions:
First of all, I was wondering if mixing video + subtitle and sending it to Youtube's rtmp url can be done from the client side, so it's simple and lightweight.
Second, should I encode the output being sent to Youtube? Can this be done from the browser too?
I'm only seeing a few node.js frameworks, and even they're not very mature (or is Webcodecs for this purpose?). Is a web app a poor choice for this task?
Lastly, if I do need a server to process the video, where should the encoding happen (from the user's machine, or in the server, or both?)? Is my server most likely going to be the bottleneck given YouTube's infrastructure, since video files are huge and my server is limited?
I am new to video streaming, so please excuse my lack of understanding of the subject. Also, if there's any good resource for my problem, please share them with me.
First of all, I was wondering if mixing video + subtitle and sending it to Youtube's rtmp url can be done from the client side, so it's simple and lightweight.
You can do the video compositing and audio mixing and what not, but browsers don't support RTMP. To get the data to an RTMP server, you need to send it to a server where it is proxied off to the final URL.
They will use their camera to record their video, and select from my app which text should be added to the video.
Yeah, that's no problem at all. Draw everything to a canvas every frame.
Second, should I encode the output being sent to Youtube?
Yes, you must. Check out the Media Recorder API.
Lastly, if I do need a server to process the video, where should the encoding happen (from the user's machine, or in the server, or both?)?
The video has to be encoded client-side to get to the server in the first place. The server can then hopefully just repackage with flv and send it along. If the browser doesn't support H.264 in its Media Recorder API, then you'll have an intermediary codec like VP8, and you'll have to transcode server-side.
A few years ago, I wrote a tutorial on how to do all of these steps here: https://github.com/fbsamples/Canvas-Streaming-Example Note that the tutorial is in the context of Facebook, but this should teach you the concepts.

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

Sending large video files to WebDav Server from iOS device

How can we send large video files to WebDav Server from iOS app. Basically I am trying to record the video and need to send it to the WebDav Server. Do I need to send as a streaming video? What are the complexities that we need to consider while sending the large video files to WebDav server. I searched for solution but no luck so far. Do we need to use any WebDav clients available for iOS to send video files to WebDav Server ?
If you want to upload the video after it has finished recording then its an ordinary PUT which you can do with any webdav client. The size of the file is only an issue to the extent that size is for any type of file.
If you want to upload as its being recorded then thats quite difficult because most video formats have header information which cant be produced until the end of file is reached.
So if your requirement is to upload progressively you might need to encode to HLS (HTTP Live Streaming) which emits self contained video chunks (usually 3 second segments) and a playlist file that HLS clients know how to use to reassemble as a single continuous playback.
This is an efficient way to enable almost live one-to-many video streaming through a webdav server. I've implemented it on kademi.co, works a treat

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.

How do I download a youtube video in iOS

I know how to launch a youtube video within an iOS web view, but how can I download that video to save on my iPad app? Is it possible? Do I need to use some call with a NSURLConnection object and then save the received data into the proper file format?
One specific point I am unsure about is what the url to request the file would be. When viewing a video on youtube, the downloadable videos are triggered with a button, so it's not evident to me what the url would be.
You would need to download an iOS-compatible version of the video, possibly using the same technique employed by the Safari FlashToHTML5 plugin.
Youtube DOES offer video download links:
http://lifehacker.com/#!5152236/youtube-offers-official-downloads-and-purchases-for-videos
.. make sure you do not violate their TOS.
In general, when downloading large files, you might consider implementing resumable file downloads, especially because connectivity on a mobile device is transient.
On top of that, make sure that you're on a wifi network when downloading (or resuming a download), using Reachability. Note that excessive bandwidth usage over cellular networks is a reason for app rejection.

Resources