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=True. 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.3.tar.gz (5.4 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.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for napari_video-0.2.3.tar.gz
Algorithm Hash digest
SHA256 7acd0fe090c40ccd2b7b899c3589278f687885300889e968d2b546a0b0306c35
MD5 9d5bbf9f439de969fd6f9ae2b2db07db
BLAKE2b-256 83fd21a586973f842cb03934e6fb063022e40bc6da438b59dbfec98668239f03

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for napari_video-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 374e44b7343fdb746347fb481c08f381f730b0c09c827db58a889a086e559083
MD5 dbc090f3ec25d530569315cfcf742465
BLAKE2b-256 25f5a1f583f8e7a0135aa561f2564707774918d826073e0e1157a91580798c09

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