Contract us
Contract us
# Flutter + Tencent Cloud Audio & Video: Compatibility Optimization of Beauty SDK under HDR Mode for Live Streaming

Updated:2026-05-29

# HDR Live Streaming Adaptation of LetMagic Beauty SDK Based on Flutter and Tencent Cloud Audio & Video High Dynamic Range (HDR) imaging has gradually become a standard feature on mobile devices. Live footage captured in HDR mode delivers richer light and shadow details as well as a wider color gamut. Nevertheless, the high-precision data stream of HDR poses severe challenges to traditional beauty algorithms. Non-linear encoding of luminance information and complex wide-gamut mapping give rise to compatibility issues in existing processing pipelines. Based on the Flutter and Tencent Cloud Audio & Video tech stack, this article discusses adaptation solutions and optimization strategies for the LetMagic Beauty SDK in HDR live streaming scenarios. ## I. Technical Characteristics of HDR and Root Conflicts with Beauty Processing Standard Dynamic Range (SDR) content adopts 8-bit color depth and the Rec.709 color gamut. In contrast, HDR content commonly uses 10-bit or 12-bit color depth along with Rec.2020 or P3 color gamut, with luminance range extended from 100 nits to 1000 nits or even higher. Such improvement in data precision brings revolutionary image quality, yet breaks many basic assumptions of conventional beauty algorithms. Skin smoothing, the core of retouching algorithms, relies on threshold segmentation and filtering designed for 8-bit data. When processing 10-bit HDR data, identical numerical differences in brightness carry distinct physical meanings. Fixed thresholds lead to inaccurate skin tone recognition, frequently resulting in over-smoothed or insufficiently retouched visuals. What makes it more complicated is the non-linear encoding of luminance. The two mainstream curves, PQ and HLG, map physical brightness to digital signals. Direct application of linear SDR processing logic will cause severe color distortion. Color gamut conversion is another major bottleneck. Beauty algorithms usually perform color adjustment in the RGB space. HDR content features far higher color saturation than SDR content. Simple matrix operations cannot accurately implement mapping between Rec.2020 and device display gamuts, leading to hue shift and color banding after beautification. ## II. HDR Adaptation of Flutter Rendering Pipeline The Flutter engine has two rendering backends: Skia and Impeller, which differ greatly in HDR support. Skia enables high dynamic range textures via OpenGL or Metal extensions, while related HDR capabilities are not fully exposed by upper-layer Dart APIs. As a next-generation rendering engine, Impeller natively supports wide-gamut rendering at the architectural level, making it the preferred choice for HDR live streaming. Zero-copy optimization is essential for texture data transmission. Each frame of HDR video contains twice the data volume of SDR video. Transferring data via CPU memory before uploading to the GPU will bring excessive bandwidth pressure and latency. Leveraging the shared texture mechanism between Flutter and native code, decoded output from Tencent Cloud Audio & Video is directly used as OpenGL or Metal textures for the beauty pipeline. Processed texture handles are sent back to the rendering layer without any pixel readback throughout the process. Render surfaces must be explicitly configured to enable HDR. Set 10-bit color depth and wide-gamut formats during surface creation to ensure full HDR compatibility across all links. Any downgrade at intermediate nodes will silently fall back to SDR mode. Dedicated detection logic is required to verify the actually applied format. ## III. HDR Refactoring of Beauty Algorithms The skin detection module is upgraded with physical luminance perception. Instead of using absolute thresholds of digital signals, the system first converts PQ or HLG encoded data to linear luminance space, and then performs segmentation according to the human visual sensitivity curve. This perceptually uniform design ensures consistent performance under varying lighting conditions. Kernel functions of filtering algorithms need recalibration. Gaussian blur radius is decoupled from luminance levels in HDR scenarios to avoid over-blurring dark areas and inadequate retouching on bright regions. The adaptive filtering strategy dynamically adjusts processing intensity based on local contrast, preserving highlight details while removing noise in shadow areas. All whitening, ruddy tone adjustment and color grading operations are implemented in perceptually uniform color spaces such as CIE XYZ and ICtCp, rather than directly modifying non-linear RGB values. A 3D lookup table is adopted for precise gamut mapping when converting images to the target display gamut, effectively suppressing color banding caused by value clipping. ## IV. Compatibility and Degradation Strategies While hardware support for HDR keeps expanding, SDR devices still dominate the market. The beauty SDK maintains two independent processing pipelines and switches dynamically according to device capabilities and content types. The detection system evaluates multiple indicators including peak screen brightness, color gamut coverage and GPU texture format support. Mixed streaming scenarios pose extra complexity. When some viewers use HDR devices and others use SDR devices in the same live room, the server needs to transcode the original HDR stream pushed by the host into SDR streams. All beauty processing is completed on the host side to avoid redundant server computation. Meanwhile, compatible metadata for both HDR and SDR is generated to guarantee consistent beauty effects after transcoding. Graceful degradation is enabled for extreme conditions. The system automatically switches to the SDR pipeline when insufficient GPU memory or overheating is detected to keep live streaming stable. Frame-by-frame gradual transition is applied during degradation to prevent abrupt changes in brightness and color, delivering smooth visual adjustment for audiences. ## V. Performance Optimization and Power Consumption Balance HDR processing involves much higher computational density than SDR. 10-bit data doubles loading bandwidth, wide-gamut conversion requires higher-dimensional matrix operations, and tone mapping for dynamic range compression demands per-pixel non-linear calculation. These overheads may cause frame rate fluctuations on mid-to-low-end devices. Optimization measures include approximate computation at the algorithm level and operator fusion at the hardware level. Neural networks for skin detection are quantized to 8-bit integer inference to boost speed with negligible quality loss. Matrix operations for color conversion are integrated into vertex shaders to reduce interpolation overhead in fragment shaders. Flutter custom shaders are utilized to offload core computation to GPU for parallel execution. Power consumption management complies with thermal design power constraints. Continuous HDR processing may trigger device thermal throttling and degrade user experience. The dynamic adjustment mechanism balances image quality and sustainability based on chip temperature and battery level: full HDR processing for sufficient power, simplified processing for low battery, and active quality reduction when overheating occurs. ## VI. Quality Evaluation and Optimization Loop Traditional PSNR metrics are no longer sufficient for HDR beauty effect evaluation. The structural similarity index takes luminance masking effects into account; color deviation is measured in perceptually uniform spaces; and temporal stability is assessed to detect inter-frame flickering. A multi-dimensional quality model is built to guide iterative algorithm optimization. Subjective evaluation is equally important. Comparative tests conducted by professional colorists and target users help identify algorithm defects in edge cases, such as excessive warm tone in candlelit scenes and insufficient contrast compression under strong outdoor light. These typical cases are used to expand training datasets and optimize model structures. Online monitoring tracks real-world performance. Statistics including beauty processing latency and effect scores are collected across different device models and network environments. A joint distribution model of performance and quality is established to locate devices with the greatest optimization potential, so as to release targeted algorithm updates and parameter tuning. ## VII. Conclusion The popularization of HDR technology elevates live streaming image quality and sets higher requirements for beauty processing. In-depth integration of Flutter and Tencent Cloud Audio & Video requires systematic upgrades to rendering pipelines, algorithm logic, compatibility policies and performance tuning. The core principle is to fully leverage the advantages of HDR dynamic range while retaining natural and consistent beauty effects, preventing experience regression amid technical upgrades. With the maturity of the Impeller engine and growing terminal computing power, HDR beauty will gradually become a standard feature for live streaming applications. Early investment in technical adaptation will turn into solid competitive advantages for products.

Back List
0.135328s