28th Symposium On Applied Computing Dependable and Adaptable Distributed Systems Track Improving Context Interpretation by Using Fuzzy Policies: The Case of Adaptive Video Streaming Lucas Provensi, Frank Eliassen, Roman Vitenberg and Romain Rouvoy 1 Adaptive Video Streaming • Increasing number of application exploiting media streaming over the Internet: • Video conferencing, video on demand, etc. • Applications need to adapt to dynamic environments: • Shared bottlenecks on the Internet 2 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Challenges of Adaptation: Information Imperfection Video Capturing Application Raw Video File network H264 Encoding RTSP Server RTP Stream RTCP reports RTSP Client H264 Decoding Video Rendering Application Save to File Application requirements regarding video quality Encoder characteristics and parameters Signaling, streaming and feedback mechanisms Shared link dynamics SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track 3 Existing Approaches • Assume precise information • Bitrate overshoots and frequent quality oscillations • Examples: Increase/decrease protocols and TFRC Original video sequence Adapted using TCP-Friendly Rate Control 4 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Proposed Solution • Development approach for adaptive systems that: • Captures imprecision by using fuzzy set theory • Integrates a fuzzy inference engine into a modular MAPE-K adaptation loop 5 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Proposed Solution • Why fuzzy sets? • Example: “Reduce bitrate when packet loss fraction is high” Degree of confidence 1 acceptable high low 0 10% 2% Packet Loss Fraction SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track 6 Proposed Solution: MAPE-K loop H264 Encoding Video Stream RTSP Client RTSP Server RTP reports Actuator Sensor RTCP reports Knowledge Base Execute Domain specific ontologies Monitor Fuzzy Adaptation Policies Plan events Analyze 7 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Proposed Solution: Knowledge Specification Video Stream Domain specific ontologyH264 RTSP Server Encoding Event Actuator Loss Event RTP reports Knowledge Base Loss Fraction Execute Low L.F. Acceptable L.F. sub-concept property Plan Domain specific ontologies Fuzzy Adaptation High L.F. Policies fuzzy predicate Sensor RULE RULE 11: : IF loss_fraction IF loss_fraction IS low ANDISrttlow IS NOT high adjustment IS positive THEN THEN adjustment IS positive WITH 0.4; RULE Monitor2 : IF loss_fraction IS high THEN adjustment IS negative RULE 3 : IF loss_fraction IS acceptable THEN adjustment IS null Analyze RULE 4 : IF accumulated_loss IS negative AND rtt IS NOT high THEN adjustment IS positive WITH 0.2; acceptable low RTSP Client Adaptation Policies high SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track 8 Proposed Solution: Analysis H264 Encoding acceptable Video Stream RTSP Server Actuator Degree reports ofRTP truth RTSP Client Sensor RULE 2 : IF loss_fraction IS high THEN adjustment IS negative Knowledge Base 0.1 0.4 low 0.1 Execute Measured Loss fraction Rule high RULE 3 : Monitor IF loss_fraction IS acceptable THEN adjustment IS null 0.4 Analyze Plan Accumulation Fuzzy values for all possible actions Fuzzification Rule Evaluation 9 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Proposed Solution: Planning H264 Encoding RTSP Server Video Stream Rate 0.4 Execute Knowledge Base Sensor null negative Monitor 0.1 -1 Adjustment crisp value Plan Defuzzification RTSP Client RTP reports Actuator Encoder adjustment Adjustment -0.2 0 positive Center of mass 1 Analyze Fuzzy values for all possible actions 10 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Evaluation: Network Level Simulations Fuzzy rate adaptation achieves better throughput, less oscillations and acceptable packet loss fraction 11 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Evaluation: Video Quality Video Quality Metric stSSIM (higher is better) Scenario 1 Scenario 2 Scenario 3 Fuzzy TFRC Fuzzy TFRC Fuzzy TFRC 0.53 0.61 0.49 0.34 0.26 0.32 Fuzzy Rate Adapt. TFRC Better overall video quality according to objective metrics SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track 12 Conclusion • Problem • Adaptation in presence of imprecise information • Our approach • Separation of concerns • Example: separate adaptation knowledge from its interpretation • Integrate a fuzzy inference engine into the adaptation loop • Validated for the case of adaptive video streaming Questions? SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track 13 14 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Evaluation (extra) • Definition of a complete set of adaptation rules implementing a PID bitrate controller • ns-2 simulations • Static topologies (dumbbell and parking lot) • Varying number of competing flows (tcp and udp) • Performance comparison with same application using TFRC protocol to determine the target bitrate • Video quality evaluation • Metrics: • • • • Peak Signal-to-Noise Ratio (PSNR), Structural Similarity Index (SSIM), Spatial-Temporal SSIM (stSSIM), DCT based Video Quality Metric (VQM) 15 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Evaluation (extra 2) • Increasing number of tcp flows • On/off traffic traversing a increasing number of intermediate routers 16 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track Evaluation (extra 3) • Media Quality Evaluation • Scenario 1: No competition; • Scenario 2: Competing with a TCP flow (new reno) and a fixed bitrate UDP flow. • Scenario 3: Competing with 10 TCP flows Metric Scenario 1 Scenario 2 Scenario 3 Fuzzy TFRC Fuzzy Fuzzy TFRC TFRC PSNR (higher is better) 33.07 29.77 35.02 32.77 26.17 25.24 SSIM (higher is better) 0.91 0.82 0.97 0.89 0.76 0.78 stSSIM (higher is better) 0.53 0.32 0.61 0.49 0.34 0.26 VQM (lower is better) 1.69 2.20 1.52 1.58 2.31 2.53 17 SAC´13 March 20, 2013, Coimbra, Portugal – DADS Track