Flash fullscreen best practices
Flash can play up to 1080p video, but in surprisingly a lot of cases the performance is limited by the non-optimized use of the fullscreen mode. In addition to that, FP 10 offers new options for fullscreen acceleration.
Here some tips how to efficiently use the fullscreen mode:
Use the fullScreenSourceRect to define zoom area and switch displayState to “fullScreen”. (Exploring full-screen mode in Flash Player 9)
Performance best practices
- fullScreenSourceRect should match the video object/movie size for best performance
- Avoid video scaling
- Disable smoothing and deblocking
- If possible no video overlays or objects below the video object
- If SWF dimensions are smaller than the dimensions of the video (e.g. 1080p video on 800 x 600 stage), scale the video area and adjust the fullScreenSourceRect to match video dimensions prior to switching to fullscreen. The fullScreenSourceRect is not restricted to Flex / Flash stage dimensions
- If scaling is required, use an even scale factor, e.g. 1/2 or 1/4 or 2x of the original size
In most cases the screen resolution and the actual video size have different dimensions, therefore video controls will change their size in fullscreen. To avoid this behavior a common practice is to use the screen resolution as fullScreenSourceRect, keep the scale of the controls and scale the video object to match the full screen dimensions. This can impact the performance of the video, especially on larger screens and with HD content.
Video control best practices
- Flash Player 9 – Use the method above with care and only if performance impact is acceptable and UI is more important (SD content/ low screen resolution)
- Flash Player 9 – Since the video resolution of HD content it closer to screen resolution, evaluate if a minor pixilation of controls is acceptable for HD. In this case use video object/movie size as fullScreenSourceRect, and perform minor resizing of the video controls.
- Flash Player 10 – The method above is acceptable if the GPU accelerated mode (via wmmode “gpu”) is used with the fullscreen mode. Do not use fullScreenSourceRect in this case and simply switch with displayState to fullscreen. Since it’s not possible to zoom to a certain area without the fullScreenSourceRect, simply zoom on the stage to the desired area when in fullscreen. The GPU acceleration will minimize the performance impact.
Dynamic streaming normally includes video streams with different dimensions. Since it’s not possible to switch the fullScreenSourceRect during fullscreen mode, and the maximum screen resolution is sometimes hard to predict with changing network conditions, one option is to use the dimensions of the highest bitrate video clip as fullScreenSourceRect.
- To avoid quality issues with lower bitrates, turn on smoothing in case the stream dimensions don’t match the video object size.
- This method might impact the performance, since streams with smaller dimensions need to scale to the video object
An alternative method is to predict the maximum possible resolution and use it as default fullscreen resolution. This might not offer the best possible quality under certain conditions (in case of upgrade to higher video quality/size during fullscreen), but offers the best performance.
If you use Flash Player 10 with GPU fullscreen (described above), multiple bitrate is not an issue – it’s possible to change the scaling during transition.