Skip to content

Add VideoFrameExtractionStage to video splitting pipeline #808

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

Open
wants to merge 13 commits into
base: aot/ray-video-clip-frame-extraction
Choose a base branch
from

Conversation

suiyoubi
Copy link
Contributor

Description

Usage

# Add snippet demonstrating usage

Checklist

  • I am familiar with the Contributing Guide.
  • New or Existing tests cover these changes.
  • The documentation is up to date with these changes.

suiyoubi added 3 commits July 15, 2025 07:46
- Introduced `VideoFrameExtractionStage` to enhance the video splitting pipeline with additional frame extraction capabilities.
- Updated the `create_video_splitting_pipeline` function to accommodate the new stage based on user-defined splitting algorithms.
- Added logic for handling the "transnetv2" splitting algorithm.

Signed-off-by: Ao Tang <[email protected]>
…ution timing

- Added command-line arguments for TransNetV2 parameters, including thresholds, minimum and maximum clip lengths, cropping size, and GPU memory allocation.
- Implemented execution time tracking in the video splitting pipeline to provide performance insights.
- Updated `VideoFrameExtractionStage` to conditionally import `PyNvcFrameExtractor` based on GPU availability.

Signed-off-by: Ao Tang <[email protected]>
Copy link

copy-pr-bot bot commented Jul 16, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@suiyoubi suiyoubi changed the title Aot/ray video video frame extraction Add VideoFrameExtractionStage to video splitting pipeline Jul 16, 2025
suiyoubi and others added 10 commits July 16, 2025 08:36
Signed-off-by: Ao Tang <[email protected]>
…nvcodec_utils.py

- Added "cvcuda_cu12" to the CUDA 12 dependencies in pyproject.toml.
- Modified nvcodec_utils.py to include a try-except block for importing libraries, logging a warning if PyNvVideoCodec is not installed, and setting related variables to None.

Signed-off-by: Ao Tang <[email protected]>
- Moved import statements for torch and loguru to the top of the file for better organization.
- Ensured consistent handling of library imports with a try-except block for cvcuda and nvcv.

Signed-off-by: Ao Tang <[email protected]>
- Removed "cvcuda_cu12" from the CUDA 12 dependencies and added it to a new "video_cuda" section for better clarity and organization of dependencies.

Signed-off-by: Ao Tang <[email protected]>
- Moved the pixel_format_to_cvcuda_code dictionary initialization inside the try block to ensure it is only defined if PyNvVideoCodec is available.
- Added a runtime check to raise an error if PyNvVideoCodec is not installed, improving error handling for users.

Signed-off-by: Ao Tang <[email protected]>
…c_utils

- Introduced a new test suite, TestImportHandling, to verify correct behavior when GPU dependencies are absent.
- Added tests to ensure pixel format mapping, VideoBatchDecoder initialization, and PyNvcFrameExtractor function gracefully fail when required libraries are missing.
- Created TestGracefulDegradation to confirm module imports and error messages are handled appropriately without GPU dependencies.

Signed-off-by: Ao Tang <[email protected]>
- Added a try-except block to check for PyNvcFrameExtractor availability, logging a warning if not found and falling back to FFmpeg for video processing.
- Updated the VideoFrameExtractionStage to handle cases where the PyNvcFrameExtractor is unavailable, ensuring graceful degradation.
- Added tests to verify behavior when PyNvc dependencies are missing, including logging checks for fallback mechanisms.

Signed-off-by: Ao Tang <[email protected]>
…tionality

- Implemented multiple test cases for VideoBatchDecoder, including dynamic sizing, unexpected tensor layout handling, and batch size variations.
- Enhanced NvVideoDecoder tests to cover scenarios with actual frame processing, unexpected layouts, and partial batch handling.
- Verified the complete processing pipeline and ensured correct behavior under various conditions, improving overall test coverage for video decoding utilities.

Signed-off-by: Ao Tang <[email protected]>
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.

1 participant