Skip to main content

Hive Video Tools

hive-video provides command-line tools and Python APIs for downloading, resequencing, and extracting fragments from honey bee hive videos. It is part of the Collective Logic Lab's honeybee-hive-video project.

  • download selects a recording from the Edmond 2019 honey bee video archive, resumes partial transfers, and verifies the archive MD5 checksum.
  • fragment extracts a PNG frame or an MP4 clip from a local video and writes a JSON sidecar with provenance and an output checksum.
  • resequence provides individual reconstruction, inspection, quality-control, and rendering stages. Its dependencies are optional.

Version 0.1.0 is the first public package release. These tools have been used in research; the packaged API is still evolving. During 0.x, incompatible interface changes receive a minor version increment and release notes. Retain a dependency lockfile for reproducible work.

Install

Use Python 3.12 or newer. To install the command-line tools with uv:

uv tool install hive-video
hive-video --version
hive-video --help

To include resequencing support, install with the optional extra:

uv tool install 'hive-video[resequence]'

FFmpeg and ffprobe are resolved automatically. The tools use an explicitly configured pair or a complete pair on PATH; otherwise, the included provider downloads and caches platform-specific builds from the FFmpeg 8 family. Prepare them before offline work with:

hive-video setup-ffmpeg

This reports their executable paths, versions, and checksums. Help and archive downloading do not need FFmpeg.

Extract a fragment

Given a local source.mp4, extract its first 25 frames:

hive-video fragment --video source.mp4 --start-frame 0 --duration-frames 25 --out clip.mp4

Omit the duration and use a .png output to extract one frame. Existing output files are refused. The bee progress display can be changed with --progress plain or disabled with --progress off.

Use from Python

Add the library to the project that will import it:

uv add hive-video

Use uv add 'hive-video[resequence]' if you also need resequencing. In a Jupyter notebook, install into the current Python kernel with %pip install hive-video or %pip install "hive-video[resequence]", then check the version in the next cell:

import hive_video

print(hive_video.__version__)

Restart the kernel if you upgraded the package after importing it. This checks the package import and loaded version. The terminal equivalent is hive-video --version (available from v0.1.1).

Then download a recording and extract a clip:

from pathlib import Path

from hive_video.download import download_video
from hive_video.fragment import create_fragment

my_dir = Path("data/day22")
source = download_video(day=22, side=0, panel="top", target=my_dir)
clip = create_fragment(source, my_dir / "clip.mp4", start=0, duration=30, unit="seconds")
print(clip)

day=22 selects the archive's sequential start22 capture identifier; the filename gives its calendar timestamp. Downloading retrieves the entire source recording, which can be tens of gigabytes. Seconds use the source's nominal frame clock. See the package interface guide for selectors, transfer settings, progress callbacks, and fragment conventions.

Resequencing and scientific scope

Resequencing is computationally expensive and includes human inspection and join quality control. Follow the stage workflow and methods record. Reconstruction does not independently establish absolute recording chronology or validate a biological interpretation.

This distribution contains the reusable video tools. Internal analyses, experimental recipes, Slurm launchers, and research data remain in the source project.

The package source is MIT licensed. FFmpeg executables are supplied separately by the selected system installation or binary provider.

Release files for hive-video 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hive-video 0.1.1
File Size Uploaded
hive_video-0.1.1.tar.gz 64.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hive-video 0.1.1
File Interpreter ABI Platform
hive_video-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 143.3 kB

Release files / hive_video-0.1.1.tar.gz

Download URL hive_video-0.1.1.tar.gz
Size 64.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c7f33023f9542c46f82a9bf62ee26bf7ab18b689539a91e7d8b33b741b394095
BLAKE2b-256 checksum
How to use checksums
f3dc7fb15c6158bccdd47e7da704bea136da08004aa2732b205f7a2b6c6166c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release files / hive_video-0.1.1-py3-none-any.whl

Download URL hive_video-0.1.1-py3-none-any.whl
Size 79.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcfeabd7321000e224f32b86658a94cff3721377a608ca1966c7c15d34a5c23f
BLAKE2b-256 checksum
How to use checksums
7d31bc80388178120f63569d94172d874525dd98fadab434bd1ba93d3af5b3c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page