Skip to content

Enhanced Video Codec Support and Error Handling #5825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 24, 2025

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Feb 21, 2025

Category:

Bug fix / Refactoring

Description:

This PR improves the video decoder's codec support detection and error handling, particularly for cases where CPU codec support is not available.

  • Added more detailed logging for codec detection and initialization failures
  • Improved fallback behavior when CPU codecs are not available
  • Added support for checking codec availability before attempting to build index
  • Enhanced error messages to include detailed stream information
  • Added new test cases for various codec support scenarios
  • Added support for AV1 and MPEG4 codecs (when available in libavcodec)
  • Improved error messages to show codec ID and name when support is missing
  • Added GetAllStreamInfo() method to provide detailed stream information for debugging
  • Modified error messages to be more informative about why codec support is unavailable
  • Simplified ReadNextFrame interface to use nullptr for skipping frames
  • Removed redundant copy_to_output parameter from frame reading methods

Additional information:

Affected modules and functionalities:

  • experimental video reader
  • experimental video decoder

Key points relevant for the review:

  • NA

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
      • test_video.test_specific_codec_support_files
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

- makes sure that the GPU video decoding capabilities are not affected
  by codecs supported on the CPU
- retains from CPU video codec initialization on the CPU for
  the experimental video reader

Signed-off-by: Janusz Lisiecki <[email protected]>
@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 21, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24339468]: BUILD STARTED

@JanuszL JanuszL changed the title Separate video codecs initialization paths for CPU adn GPU in the reader Separate video codecs initialization paths for CPU and GPU in the reader Feb 21, 2025
@mzient mzient self-assigned this Feb 21, 2025
"vp8",
"vp9",
"mpeg4",
] # av1 and mpeg4 are not supported by now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear comment: mpeg4 is listed above, av1 isn't - so what does it mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Signed-off-by: Janusz Lisiecki <[email protected]>
@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 21, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24343878]: BUILD STARTED

Signed-off-by: Joaquin Anton Guirao <[email protected]>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24347657]: BUILD STARTED

@jantonguirao jantonguirao changed the title Separate video codecs initialization paths for CPU and GPU in the reader Enhanced Video Codec Support and Error Handling Feb 21, 2025
if (!FindVideoStream(init_codecs || build_index)) {
return;
if (build_index) {
init_codecs = true; // for the sake of build_index, we need to init the codecs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain? I though that it is enough to read the packets without having the codec initialized?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it wasn't necessary after all. I cleaned this up

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24347657]: BUILD FAILED

Signed-off-by: Joaquin Anton Guirao <[email protected]>
Signed-off-by: Joaquin Anton Guirao <[email protected]>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24350975]: BUILD STARTED

Signed-off-by: Joaquin Anton Guirao <[email protected]>
Signed-off-by: Joaquin Anton Guirao <[email protected]>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24339468]: BUILD FAILED

@jantonguirao
Copy link
Contributor

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24362754]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24350975]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24362754]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [24362754]: BUILD PASSED

@jantonguirao jantonguirao merged commit 2febb1f into NVIDIA:main Feb 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants