Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ios]: HLS (m3u8) vs mp4 - very high energy impact + thermal throttling (display brightness dimming) #95

Open
hirbod opened this issue Sep 26, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@hirbod
Copy link
Contributor

hirbod commented Sep 26, 2022

Hi,

I did some energy impact testing and also noticed that when I am using HLS vs mp4, mp4 consumes way less CPU (which is kinda expected since it does have less Network and parsing overhead), but my iPhone 13 Pro Max heats up pretty heavy, thermal state jumps from nominal to serious and the energy impact is super high.

Test device

  • iPhone 13 Pro Max
  • iOS 16

mp4

Bildschirmfoto 2022-09-26 um 21 17 05

HLS

Bildschirmfoto 2022-09-26 um 21 00 15

Is there a way to make IVS more battery friendly? My streams just have 2 qualities (480p and 720p).

The screenshot with better energy consumption was achieved with mp4 instead of HLS.

I really couldn't find much information around that.

@hirbod hirbod added the bug Something isn't working label Sep 26, 2022
@hirbod
Copy link
Contributor Author

hirbod commented Sep 27, 2022

It looks like the CPU usage is different when I use a live stream (energy consumption is very high but I never reach the point where my screen brightness dims and I don't feel like the device is heating up).

It's more like it has issues with very simple and default m3u8 files, even though when you only deliver one quality. The live video example URL on the README does not heat up the phone. There is some heavy CPU usage going on - I think related to how the m3u8 is built.

Looks like m3u8 like this one are heavy

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=720x1280
720x1280/video.m3u8

Here is an example that smashes my iPhone:
https://d3rlna7iyyu8wu.cloudfront.net/skip_armstrong/skip_armstrong_multi_language_subs.m3u8

This one gets the CPU
Bildschirmfoto 2022-09-27 um 22 08 05
Bildschirmfoto 2022-09-27 um 22 08 16
up to 203%, the others have been ~103%, wile MP4 is 4-15% CPU.

@hirbod hirbod changed the title HLS (m3u8) vs mp4 - very high energy impact + possible thermal throttling HLS (m3u8) vs mp4 - very high energy impact + thermal throttling (display brightness dimming) Sep 28, 2022
@hirbod hirbod changed the title HLS (m3u8) vs mp4 - very high energy impact + thermal throttling (display brightness dimming) [ios]: HLS (m3u8) vs mp4 - very high energy impact + thermal throttling (display brightness dimming) Sep 28, 2022
@hirbod
Copy link
Contributor Author

hirbod commented Sep 29, 2022

After comparing this to native AVAsset/AVFoundation and react-native-video vs expo-av, I can tell you that this is only happening with this library. There is an internal issue with the IVS SDK on iOS which causes HLS to go nuts on the CPU. @maxstoller. Android is fine. Turning logLevel to 1 didn't give me any useful insights and since the source for IVS is not open, I could not dig into this any further. I'd really appreciate if this could be investigated.

I played with every prop there is (removing observers, using quality etc). No chance to drop the CPU down to 4-15% - where it belongs.

@maxstoller
Copy link
Contributor

We have seen “Very High” energy usage during normal playback of IVS streams possibly due to the network activity needed for low latency playback.

Are you able to reproduce the high CPU usage issue using any of the example IVS test streams?

@hirbod
Copy link
Contributor Author

hirbod commented Oct 15, 2022

@maxstoller I see better results with the IVS test streams (as also pointed out in my posts already) but I see very bad results with anything thats not IVS. I really don't want to have an App with multiple players included for video coming from IVS and non-ivs. The issue is iOS only and Android works fine with HLS and Mp4. iOS on the other hand works fine only for direct mp4 urls, while it has okish results for IVS streams and terribe results for anything else.

Is it possible to disable the low latency playback to circumvent this? The available flags (I tested really all of them) do not change anything. And what I also figured for non ivs-hls streams in 95% of the times that the audio has a small stutter between 3 and 5 seconds, mostly 5 seconds exactly.

@anatoleblanc
Copy link

Any update on that? Temperature of my iphone is rising from 23 to 30 degrees while reading HLS streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants