Commit f971951
committed
decoder: Default to valid profiles when demuxer reports unknown profile
When FFmpeg's demuxer reports an invalid or unknown profile (e.g.,
profile=0 for raw .265/.264 files without container metadata, or
mis-tagged Baseline for interlaced H.264), default to a safe profile:
H.264: Default to HIGH (100) -- superset of Baseline/Main, handles
interlaced, CABAC, B-slices, weighted prediction. Matches NVCUVID.
H.265: Default to MAIN (1) -- covers most 8-bit 4:2:0 content.
AV1: Default to MAIN (0).
The fix is in FFmpegDemuxer::GetProfileIdc() so it covers both
VulkanVideoProcessor::Initialize() and VkVideoDecoder::StartVideoSequence()
code paths. A warning is printed when a default is used.
Additionally, VkVideoDecoder::StartVideoSequence() retries with
upgraded profiles (Baseline→Main→High for H.264, Main→Main10 for
H.265) if the initial capabilities query fails, as a second line of
defense when the parser-reported profile differs from the demuxer.
Fixes: Assert on 1080i-25-H264.mkv (interlaced Baseline)
Fixes: Assert on 2024-05-03_14-55-55_1080p_p1_vbv2_5Mbps.265 (raw H.265)
Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>1 parent 90ceee6 commit f971951
File tree
2 files changed
+43
-3
lines changed- vk_video_decoder/libs
- VkDecoderUtils
- VkVideoDecoder
2 files changed
+43
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
408 | 413 | | |
409 | 414 | | |
410 | 415 | | |
| |||
418 | 423 | | |
419 | 424 | | |
420 | 425 | | |
421 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
422 | 431 | | |
423 | 432 | | |
424 | 433 | | |
| |||
430 | 439 | | |
431 | 440 | | |
432 | 441 | | |
433 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
434 | 445 | | |
435 | 446 | | |
436 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
213 | 242 | | |
214 | 243 | | |
215 | 244 | | |
| |||
0 commit comments