HLS streaming, advices about segment size configuration - ios

we are developing a mobile application which will need to play 10 seconds videos.
The first version will only support iOS (iPhone & iPad). To have a good quality on all devices we will use Adaptive Streaming.
I thorougly read the Apple HLS documentation and it seems that 10 seconds is a good tradeoff for the size of the HLS segments.
So if we use the default 10 seconds in our case segmentation is not really useful.
As we are on a Mobile app with very small videos I'm wondering if for some devices / network conditions changing this 10s "default" to a smaller value could be better ?
Is it possible to speed-up the starting of the video by lowering this value ?
I suppose the 10 seconds "default" we find everywhere is a good choice and advice for videos which have to be played "everywhere" (Desktop, Smartphone, Tablet), but perhaps an other value would be more appropriate for Smartphones only ?
Finally do you think that in our case HLS is not a good choice and that simply using progressive download of an MP4 video is better?
Thanks in advance for your responses.

Mp4 will be better. Adaptive streaming works well for long content, but very poorly for short videos. The player will not have enough time to to adapt, and your viewers you almost always just see the default quality.
Apple only requires HLS for videos that are longer than X seconds (I cant remember exactly what X is, but it is larger than 10)

Related

What options are there for low latency video streaming in the iOS webview?

I need a to display a low latency (less than 5 seconds) video stream in my HTML5 app. The app is running in a webkit webview on iOS (not mobile Safari). I have explored and eliminated the below options.
Are there any options out there for displaying a low latency video stream in a webview?
WebRTC:
JS API not implemented in webview (although now supported in mobile safari)
RTMP:
Flash players not supported in webview
RTSP:
Not supported on iOS even when tunneled through websockets (Streamedian).
HLS and/or DASH:
Latency is too high
I've been working on a project that allows low latency HLS with any normal player all the way back in 2016 for that specific reason - no support for this from at that point any of the native players.
In HLS is actually quite easy to go quite low on latency, but it does require a server working in a bit different way than a normal file server - it should present the chunks on the playlist before they appear and wait until they show up when they're requested.
I have decided to open source my efforts so you can try this here: github.com:signicode/ahead-server.
There are things to be done, so all the help is welcome.

AVFoundation, limiting video streaming playback to WiFi only

I'm developing a player using AVFoundation. The source videos I have no control over but they certainly violate:
https://developer.apple.com/streaming/
REQUIREMENTS FOR APPS
...If your app delivers video over cellular networks, and the video exceeds either 10 minutes duration or 5 MB of data in a five minute period, you are required to use HTTP Live Streaming. (Progressive download may be used for smaller clips.)...
I'm talking mp4 videos that are 100Mb+ for 3 to 5 min clips.
Again, 0 control over the source material but I have to play them.
Looking at AVFoundation, none of the classes I'm using, AVPlayer, AVPlayerItem, AVQueuePlayer and so on have a similar property to a NSURLSessionConfiguration's .allowsCellularAccess (at least that I can see)
So agreement with the client was to limit the streaming to Wifi only, but I see no way around at the moment to force streaming over WiFi only.
Any pointers on how to get around it?
Any help is MUCH appreciate

How many times should I tell ios app user he is on Carrier network?

According to apple (9.3 and 9.9 https://developer.apple.com/appstore/resources/approval/guidelines.html ) I need to tell (doesn´t explicitly say that but that was my understanding) the user of my app that he is not on a Wifi network and if he streams the content of my app it could cost him lots of money.
What I can't find out is:
Do I have to give the user constant warnings e.g for every link he clicks OR is it enough to just give him warning one time while he is in the app? I mean he could be in the app for hours (hopefully :-)).
EDIT:
After rereading https://developer.apple.com/appstore/resources/approval/guidelines.html I see that I have not totally understood the guideline.
It says :
9.3 Audio streaming content over a cellular network may not use more than 5MB over 5 minutes 9.9 Video streaming content over a cellular network longer than 10 minutes must use HTTP Live Streaming and include a baseline 64 kbps audio-only HTTP Live stream
So my understanding now is that I would need to tell the user about the usage after 10 minutes OR after 5MB download after 5 minutest? No that just can´t be! Can it?
My program is just a container around Youtube streaming video from them.

Echoprint not recognizing a single song

Echoprint “listens” to audio on a phone or on your computer to figure out what song it is. It does so very fast and with such good accuracy that it can identify very noisy versions of the original or recordings made on a mobile device with a lot of interference from outside sources.
I compiled the iOS example provided on the website. So far so good.
Sadly, Echoprint failed to recognize any song via the iPhone's microphone (recording time up to 1 minute).
On the other hand, it was capable of recognizing songs by "uploading" them directly from the iPhone's media library.
Any idea, what the problem could be?
Echo print is not intended to work over the air. At least not with the given configuration. You can adapt the code, focus on the matching functions (best_match), to get some results for over-the-air configuration. The actual best_match function returns a song only if it is really close to the reference, which won't happened with songs recorded with the microphone of your phone. Also consider recording a longer segment.
I think the problem is the sampling rate at which the song is being recorded. If it's at 8 kHz it probably won't work; it has to be at least a minimum of 11 kHz.

Is RTSP allowed on iOS or one MUST use Http Live Streaming instead?

Apple Http Live Streaming Overview document clearly states that streaming videos exceeding 10 minutes cannot be downloaded progressively and MUST be transferred using Http Live Streaming(HLS). It also states that the latency of HLS is in the neighbourhood of 30 seconds.
In my case, I am building an app that needs to receives live steaming videos in almost real-time. So on one hand I must use HLS for real time streaming but it is not fast enough. On the other hand I can not use anything else because it seems anything other than HLS is not allowed. I know RTSP is possible on iOS but will it be approved by the App Store?
Cheers,
M.
Apple is not transparent. The only way to know if an app will be rejected or accepted is to submit it.

Resources