|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>HDR Video Comparison</title> |
| 7 | + <style> |
| 8 | + body { |
| 9 | + background-color: black; |
| 10 | + color: #e0e0e0; |
| 11 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; |
| 12 | + margin: 0; |
| 13 | + padding: 20px; |
| 14 | + } |
| 15 | + .grid-container { |
| 16 | + display: flex; |
| 17 | + flex-wrap: wrap; |
| 18 | + gap: 20px; |
| 19 | + justify-content: center; /* Centers items if they don't fill the row */ |
| 20 | + } |
| 21 | + .video-card { |
| 22 | + flex: 0 0 600px; /* Fixed width of 600px */ |
| 23 | + display: flex; |
| 24 | + flex-direction: column; |
| 25 | + align-items: center; |
| 26 | + background-color: #1a1a1a; |
| 27 | + padding: 10px; |
| 28 | + border-radius: 8px; |
| 29 | + box-sizing: border-box; |
| 30 | + } |
| 31 | + video { |
| 32 | + width: 100%; |
| 33 | + height: auto; |
| 34 | + border-radius: 4px; |
| 35 | + } |
| 36 | + .filename { |
| 37 | + margin-top: 10px; |
| 38 | + font-family: monospace; |
| 39 | + font-size: 0.9em; |
| 40 | + word-break: break-all; |
| 41 | + } |
| 42 | + #capabilities { |
| 43 | + margin-top: 40px; |
| 44 | + padding: 20px; |
| 45 | + background-color: #111; |
| 46 | + border-top: 2px solid #333; |
| 47 | + text-align: center; |
| 48 | + border-radius: 8px; |
| 49 | + } |
| 50 | + .cap-item { |
| 51 | + margin: 10px 0; |
| 52 | + font-size: 1.1em; |
| 53 | + } |
| 54 | + .highlight { |
| 55 | + color: #4caf50; |
| 56 | + font-weight: bold; |
| 57 | + } |
| 58 | + </style> |
| 59 | +</head> |
| 60 | +<body> |
| 61 | + |
| 62 | + <div class="grid-container"> |
| 63 | + <!-- Video 1 --> |
| 64 | + <div class="video-card"> |
| 65 | + <video autoplay muted playsinline loop> |
| 66 | + <source src="output_hdr10.mp4" type="video/mp4"> |
| 67 | + Your browser does not support the video tag. |
| 68 | + </video> |
| 69 | + <div class="filename">No display-master parameters specified, should show full HDR rec2020 if available..</div> |
| 70 | + </div> |
| 71 | + |
| 72 | + <!-- Video 2 --> |
| 73 | + <div class="video-card"> |
| 74 | + <video autoplay muted playsinline loop> |
| 75 | + <source src="output_hdr10_rec709.mp4" type="video/mp4"> |
| 76 | + Your browser does not support the video tag. |
| 77 | + </video> |
| 78 | + <div class="filename">Configured to only show rec709 using the display-master, if you see the full HDR, then the tonemapping isnt working correctly.</div> |
| 79 | + </div> |
| 80 | + |
| 81 | + <!-- Video 3 --> |
| 82 | + <div class="video-card"> |
| 83 | + <video autoplay muted playsinline loop> |
| 84 | + <source src="output_hdr10_p3.mp4" type="video/mp4"> |
| 85 | + Your browser does not support the video tag. |
| 86 | + </video> |
| 87 | + <div class="filename">Full 2000 nit HDR, but with p3 gamut display master.</div> |
| 88 | + </div> |
| 89 | + |
| 90 | + <!-- Video 4 --> |
| 91 | + <div class="video-card"> |
| 92 | + <video autoplay muted playsinline loop> |
| 93 | + <source src="output_srgb.mov" type="video/quicktime"> |
| 94 | + <source src="output_srgb.mov" type="video/mp4"> |
| 95 | + Your browser does not support the video tag. |
| 96 | + </video> |
| 97 | + <div class="filename">Reference HDR converted to sRGB using tonemapping, this gives you a sense of what you should see if tonemapping is working correctly.</div> |
| 98 | + </div> |
| 99 | + </div> |
| 100 | + |
| 101 | + <div id="capabilities"> |
| 102 | + <h2>System Display Capabilities</h2> |
| 103 | + <div class="cap-item" id="gamut-info">Detected Gamut: Checking...</div> |
| 104 | + <div class="cap-item" id="hdr-info">HDR Support: Checking...</div> |
| 105 | + </div> |
| 106 | + |
| 107 | + <script> |
| 108 | + function checkCapabilities() { |
| 109 | + const gamutInfo = document.getElementById('gamut-info'); |
| 110 | + const hdrInfo = document.getElementById('hdr-info'); |
| 111 | + |
| 112 | + // 1. Detect Color Gamut |
| 113 | + let gamut = []; |
| 114 | + if (window.matchMedia('(color-gamut: srgb)').matches) gamut.push('sRGB'); |
| 115 | + if (window.matchMedia('(color-gamut: p3)').matches) gamut.push('P3'); |
| 116 | + if (window.matchMedia('(color-gamut: rec2020)').matches) gamut.push('Rec.2020'); |
| 117 | + |
| 118 | + if (gamut.length > 0) { |
| 119 | + // The last one is usually the widest supported |
| 120 | + gamutInfo.innerHTML = `Detected Gamut: <span class="highlight">${gamut[gamut.length - 1]}</span> (Support: ${gamut.join(', ')})`; |
| 121 | + } else { |
| 122 | + gamutInfo.textContent = 'Detected Gamut: Unknown'; |
| 123 | + } |
| 124 | + |
| 125 | + // 2. Detect HDR |
| 126 | + let isHDR = false; |
| 127 | + let hdrText = 'SDR (Standard Dynamic Range)'; |
| 128 | + |
| 129 | + // Check 'dynamic-range' (screen capabilities) |
| 130 | + if (window.matchMedia('(dynamic-range: high)').matches) { |
| 131 | + isHDR = true; |
| 132 | + hdrText = 'HDR (High Dynamic Range)'; |
| 133 | + } |
| 134 | + |
| 135 | + // Check 'video-dynamic-range' (specifically for video plane) |
| 136 | + let videoHDR = ''; |
| 137 | + if (window.matchMedia('(video-dynamic-range: high)').matches) { |
| 138 | + videoHDR = ' [Video Plane: HDR Supported]'; |
| 139 | + } |
| 140 | + |
| 141 | + hdrInfo.innerHTML = `Dynamic Range: <span class="highlight">${hdrText}</span>${videoHDR}`; |
| 142 | + } |
| 143 | + |
| 144 | + // Run initially |
| 145 | + checkCapabilities(); |
| 146 | + |
| 147 | + // Listen for changes (e.g. moving window to another monitor) |
| 148 | + const queries = [ |
| 149 | + '(color-gamut: srgb)', |
| 150 | + '(color-gamut: p3)', |
| 151 | + '(color-gamut: rec2020)', |
| 152 | + '(dynamic-range: high)', |
| 153 | + '(video-dynamic-range: high)' |
| 154 | + ]; |
| 155 | + |
| 156 | + queries.forEach(q => { |
| 157 | + try { |
| 158 | + window.matchMedia(q).addEventListener('change', checkCapabilities); |
| 159 | + } catch (e) { |
| 160 | + // old browser support |
| 161 | + try { |
| 162 | + window.matchMedia(q).addListener(checkCapabilities); |
| 163 | + } catch (e2) {} |
| 164 | + } |
| 165 | + }); |
| 166 | + </script> |
| 167 | +</body> |
| 168 | +</html> |
0 commit comments