RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
236 stars 28 forks source link

Change resolution at runtime #1563

Closed dw8869 closed 1 year ago

dw8869 commented 1 year ago

How do I change the resolution at runtime? We are considering limiting the video resolution if the device runs out of memory.

Ste-RH commented 1 year ago

Assuming you mean when using an adaptive streaming solution?

This might be achievable on Android/Apple platforms using the preferred maximum resolution found in the platform options (see preferredMaximumResolution in MediaPlayer_PlatformOptions.cs)

dw8869 commented 1 year ago

@Ste-RH Does it apply if I change that option during video playback? or should I change the options before loading the video?

Chris-RH commented 1 year ago

We do have a similar enhancement that we would like to look into implementing in the future: https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/1214

dw8869 commented 1 year ago

@Chris-RH So.. any plan for #1214 ?

Ste-RH commented 1 year ago

@Ste-RH Does it apply if I change that option during video playback? or should I change the options before loading the video?

Yes, I believe this should work on Android/Apple platforms during playback. Though, after setting the maximum resolution and/or bitrate the underlying playback APIs will first continue to playback anything already downloaded and so you will not see an instant switch to a lower resolution. This buffer amount, for example, can be be quite a number of seconds depending on the platform and video setup (manifest and segment lengths).

Ste-RH commented 1 year ago

@Chris-RH So.. any plan for #1214 ?

This will not be implemented in version 2.x of AVPro Video. It is on the roadmap for version 3.0 (we have no certain release date for this as yet).

dw8869 commented 1 year ago

@Ste-RH Okay, thank you for the information.