Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@times-visuals/canvas-video

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@times-visuals/canvas-video

A React component for rendering a spritesheet as a video using canvas

latest
npmnpm
Version
1.2.0
Version published
Maintainers
2
Created
Source

Canvas Video

This is the description for the component

Installation

# Yarn
$ yarn add @times-visuals/canvas-video

# npm
$ npm add @times-visuals/canvas-video

Usage

import CanvasVideo from "@times-visuals/canvas-video";

export default () => (
  <CanvasVideo
    file="s3-eu-west-1.amazonaws.com/nuk-tnl-editorial-prod-staticassets/2019/bercow-sprite.png"
    frames={180}
    fps={60}
    cols={10}
    width={550}
    height={420}
  />
);

frames = Total number of frames in the sprite file
fps = Frames per second
cols = Total number of cols in the sprite file
width/height = Of the canvas itself

FFmpeg

To generate the frames used for the sprite file you need to run the following commands:

'ffmpeg -i bercow_no_back.mov -vf "fps=60,crop=950:950:525:40" frames/%3d.png'

And the following to stitch them back together:

'montage -border 0 -geometry 375x -tile 10x -quality 60% -background none frames/*.png myvideo.png'

FAQs

Package last updated on 14 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts