Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
Download player/runtime/python/Lib/site-packages/rerun/experimental/video.py from alinarus/MultimodalData: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/experimental/video.py
- Command line
-
hf download hf://datasets/alinarus/MultimodalData/player/runtime/python/Lib/site-packages/rerun/experimental/video.py
-
curl -L -o video.py https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/experimental/video.py
886 Bytes
| """Utilities for working with encoded video sample streams.""" | |
| from __future__ import annotations | |
| from typing import TYPE_CHECKING | |
| from rerun_bindings import ( | |
| video_detect_gop_start, | |
| video_length_prefixed_to_annex_b as length_prefixed_to_annex_b, | |
| ) | |
| if TYPE_CHECKING: | |
| from ..components import VideoCodec | |
| __all__ = [ | |
| "detect_gop_start", | |
| "is_annex_b", | |
| "length_prefixed_to_annex_b", | |
| ] | |
| def is_annex_b(sample: bytes) -> bool: | |
| """Whether the sample starts with an Annex B start code (`00 00 01` or `00 00 00 01`).""" | |
| return sample.startswith((b"\x00\x00\x00\x01", b"\x00\x00\x01")) | |
| def detect_gop_start(sample: bytes, codec: VideoCodec) -> bool: | |
| """ | |
| Detect whether a video sample starts a group of pictures, i.e. is a keyframe. | |
| H.264/H.265 samples must be in Annex B format. | |
| """ | |
| return video_detect_gop_start(sample, codec.value) | |