Skip to content

Feat/bytes video decode#25

Draft
XiDianZuoYun wants to merge 2 commits into
NVIDIA:mainfrom
XiDianZuoYun:feat/bytes-video-decode
Draft

Feat/bytes video decode#25
XiDianZuoYun wants to merge 2 commits into
NVIDIA:mainfrom
XiDianZuoYun:feat/bytes-video-decode

Conversation

@XiDianZuoYun
Copy link
Copy Markdown
Contributor

Description

This change adds bytes-like buffer support to the on-demand video decoder GOP workflows.

Specifically, it:

  • Allows SharedGopStore.put() to accept bytes, bytearray, and memoryview directly, in addition to numpy.ndarray.
  • Allows GOP decode bindings such as DecodeFromGOP, DecodeFromGOPRGB, DecodeFromGOPListRGB, and DecodeFromPacketListRGB to accept generic Python bytes-like buffers via py::buffer.
  • Keeps existing numpy-array based workflows compatible.

This is needed for data pipelines where video/GOP packet data is already available as raw bytes, for example from record files, mmap slices, shared-memory buffers, or custom storage backends. It avoids
requiring callers to wrap those payloads into numpy arrays before caching or decoding.

Affected components:

  • accvlab.on_demand_video_decoder
  • SharedGopStore
  • PyNvGopDecoder Python bindings for GOP/packet decode paths

Type of Change 选这个:

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation / examples / tutorials / demos
  • Supporting functionality change (fix or feature in documentation generation, helper scripts, ...)
  • Refactoring / internal change
  • Other (please describe):

Testing 可以写:

  • Tests added or updated if/as needed
  • Repository test runner executed: scripts/run_tests.sh

Added SharedGopStore tests for bytes, bytearray, memoryview, and empty byte payload validation.

Validation performed locally:

  • git diff --check
  • Python compile check for updated Python files
  • Manual regression for bytes-like SharedGopStore.put() path
  • Minimal pybind11 extension compile/import check for std::vector<py::buffer> and nested buffer-list casting

Full repository test runner was not executed because this local environment is missing pytest and the full native extension build is blocked by missing FFmpeg headers.

Documentation / Code Quality 可以填:

Documentation, Examples, Tutorials, Demos

  • User-facing documentation updated if/as needed (including API docs)
  • Examples / tutorials / demos updated or added (if relevant)
  • Limitations and constraints documented (if relevant)
  • Performance documented (if relevant)
  • Documentation building successful & checks outlined in the Documentation Checks section are performed

Updated pybind API docstrings to mention bytes-like inputs. No examples or performance docs were needed.

Code Quality

  • Dependencies updated in the relevant pyproject.toml if/as needed
  • Code formatted according to the Code Formatting Guide

No dependency changes were required. git diff --check passed.

}
return AVERROR(ENOSYS);
}
virtual int64_t Size() const { return -1; }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

这里应该是unimplentmented error

@xupinjie xupinjie self-requested a review June 1, 2026 08:31
@XiDianZuoYun XiDianZuoYun force-pushed the feat/bytes-video-decode branch 3 times, most recently from ab6f4f5 to 9d10693 Compare June 1, 2026 10:07
@XiDianZuoYun XiDianZuoYun force-pushed the feat/bytes-video-decode branch from 9d10693 to 44270a1 Compare June 1, 2026 10:22
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