edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! The `profile` a video stream states, spelled as ffprobe spells its |
| 2 | //! `stream=profile` field ([`crate::VideoFacts::profile`]). Each answer is read |
| 3 | //! from the stream's own configuration: the H.264 SPS, the HEVC `hvcC` |
| 4 | //! `general_profile_idc`, the AV1 sequence header's `seq_profile`, or the VP9 |
| 5 | //! frame header's profile bits, or the VP8 frame tag's version bits. Anything |
| 6 | //! else is `None`. |
| 7 | |
| 8 | use ; |
| 9 | |
| 10 | /// The H.264 profile the first SPS in `sets` states, where `sets` is Annex-B |
| 11 | /// framed the way both demuxers keep their parameter sets. |
| 12 | pub |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | /// Whether the first SPS in `sets` has `frame_mbs_only_flag` 0. |
| 21 | pub |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | /// The name of an H.264 `profile_idc` under its `constraint_setX_flag` bits |
| 31 | /// (set0 is bit 7). Constrained Baseline is set1 on a Baseline stream, and the |
| 32 | /// intra variants are set3 on the High 10, 4:2:2 and 4:4:4 Predictive profiles. |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | /// The HEVC profile of an `hvcC` record: its `general_profile_idc`, the low five |
| 53 | /// bits of the byte after the configuration version. |
| 54 | pub |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | /// The AV1 profile the sequence header OBU in `obus` states (`seq_profile`, the |
| 65 | /// top three bits of its first payload byte). `obus` is the `av1C` configuration |
| 66 | /// OBUs, or the sequence header as a bitstream carries it. |
| 67 | pub |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | /// The VP9 profile of a frame: `profile_low_bit` and `profile_high_bit`, the two |
| 94 | /// bits after the two-bit frame marker, read most significant first. |
| 95 | pub |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | /// The VP8 profile of a frame: the `version` field of its frame tag, the first |
| 106 | /// three bytes read as a little-endian 24-bit value, whose bits 1 to 3 hold it. |
| 107 | /// Versions above 3 name no profile ffprobe knows, so they are `None`. |
| 108 | pub |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | /// The ProRes flavour a sample entry's fourcc names, in Apple's own words (the name the |
| 122 | /// ProRes white paper and every NLE use, not ffprobe's `Standard` / `4444 XQ`): `422 Proxy` |
| 123 | /// (`apco`), `422 LT` (`apcs`), `422` (`apcn`), `422 HQ` (`apch`), `4444` (`ap4h`) and |
| 124 | /// `4444 XQ` (`ap4x`). The frame header states none of it, so a track whose fourcc is something |
| 125 | /// else (or that has none, as in a Matroska or AVI wrapper) states no profile. |
| 126 | pub |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | /// The Avid profile of a DNxHD / DNxHR frame. The DNxHR compression ids (1270 to 1274) are |
| 139 | /// the profiles themselves: `DNxHR 444`, `DNxHR HQX`, `DNxHR HQ`, `DNxHR SQ`, `DNxHR LB`. A |
| 140 | /// DNxHD one is named by its nominal data rate, which is constant: a frame's bytes over its |
| 141 | /// duration (`bytes` of the first sample at `fps`), snapped to the nearest of Avid's rates |
| 142 | /// within 6 %, with an `x` for the 10-bit ones (`DNxHD 145`, `DNxHD 220x`). `None` for a rate |
| 143 | /// that is none of Avid's, or an unknown frame rate. |
| 144 | pub |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | /// The MPEG-4 Part 2 profile of a track: `H.263` for a 3GPP / QuickTime H.263 sample entry, else |
| 190 | /// the `profile_and_level_indication` of the Visual Object Sequence header (`00 00 01 B0`) in |
| 191 | /// `vol` -- `Simple` (levels 0 to 3), `Advanced Simple` (`0xF0` to `0xF5`) or the other names |
| 192 | /// ISO/IEC 14496-2 Annex G gives. `None` for a configuration with no sequence header, which |
| 193 | /// states none. |
| 194 | pub |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | /// The DV flavour of a frame's system, in the broadcast names: `DV25` (consumer DV, DVCAM and |
| 222 | /// DVCPRO25 -- one bit rate, one stream type), `DVCPRO50` and `DVCPRO HD`. |
| 223 | pub |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | /// The layout of uncompressed video, from the `BITMAPINFOHEADER` an AVI keeps or the one the mov |
| 234 | /// demuxer synthesizes (marked `mov ` where `biSize` sits): the FourCC's usual name (`YUY2`, |
| 235 | /// `UYVY`, `YVYU`, `I420`, `YV12`, `NV12`, `Y800`, `v210`), else by depth for a DIB (`BGR24`, |
| 236 | /// `BGRA`, `RGB555`, `PAL8`). A mov entry is named by its own FourCC and depth: `raw ` is `RGB24`, |
| 237 | /// `ARGB` or `RGB555`, `2vuy` is `UYVY`, `yuvs` `YUY2`, `yuv2` `yuv2`, `v210`, `v410`, `b16g` `Gray16`. |
| 238 | pub |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | /// An unsigned LEB128 value and how many bytes it took. |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 |