Skip to main content

napari plugin for reading videos.

Project description

napari-video

Napari plugin for working with videos.

Relies on pyvideoreader as a backend which itself uses opencv for reading videos.

Installation

pip install napari[all] napari_video

Usage

From a terminal:

napari video.avi

Or from within python:

import napari
from napari_video.napari_video import VideoReaderNP

path='video.mp4'
vr = VideoReaderNP(path)
with napari.gui_qt():
    viewer = napari.view_image(vr, name=path)

Internals

napari_video.napari_video.VideoReaderNP exposes a video with a numpy-like interface, using opencv as a backend.

For instance, open a video:

vr = VideoReaderNP('video.avi')
print(vr)
video.avi with 60932 frames of size (920, 912, 3) at 100.00 fps

Then

  • vr[100] will return the 100th frame as a numpy array with shape (902, 912, 3).
  • vr[100:200:10] will return 10 frames evenly spaced between frame number 100 and 200 (shape (10, 902, 912, 3)).
  • Note that by default, single-frame and slice indexing return 3D and 4D arrays, respectively. To consistently return 4D arrays, open the video with remove_leading_singleton=False. vr[100] will then return a (1, 902, 912, 3) array.
  • We can also request specific ROIs and channels. For instance, vr[100:200:10,100:400,800:850,1] will return an array with shape (10, 300, 50, 1).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari_video-0.2.8.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_video-0.2.8-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file napari_video-0.2.8.tar.gz.

File metadata

  • Download URL: napari_video-0.2.8.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for napari_video-0.2.8.tar.gz
Algorithm Hash digest
SHA256 0735a97992538a595250b14761fe88e845163931c61cc77540c6570806d648a1
MD5 c68e86bf5671aaee376a719d4d021ec5
BLAKE2b-256 ecf9d626632fe68893646df4faf40c5a43da4e801865db55df6af231830d8193

See more details on using hashes here.

File details

Details for the file napari_video-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: napari_video-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for napari_video-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c4f530a9bd58b39bb68bd2ddeefdd53695be966af696d7b1c3d22cf5c2fa1990
MD5 a9c4ec2b8adc98862f36c6291a4fe49d
BLAKE2b-256 e44e2ee364ce32b935b32d3922de05f978fc5a7269fa28399aa9ddad9bacaffd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page