All Projects → feross → Capture Frame

feross / Capture Frame

Licence: mit
Capture video screenshot from a `<video>` tag (at the current time)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Capture Frame

1click Webpage Screenshot
Entire page Screenshot extension for Google Chrome. I'm developing open source extension for Google Chrome. All extension are free for use. Let's make Chrome great again!
Stars: ✭ 406 (+272.48%)
Mutual labels:  screenshot, capture
Exokit
Native VR/AR/XR engine for JavaScript 🦖
Stars: ✭ 809 (+642.2%)
Mutual labels:  browser, canvas
Deviceframe
📱 Put device frames around your mobile/web/progressive app screenshots.
Stars: ✭ 507 (+365.14%)
Mutual labels:  screenshot, frame
KeyPlexer
Capstone: Keylogger Trojan
Stars: ✭ 32 (-70.64%)
Mutual labels:  screenshot, capture
Color.js
Extract colors from an image (0.75 KB) 🎨
Stars: ✭ 42 (-61.47%)
Mutual labels:  browser, canvas
Menyoki
Screen{shot,cast} and perform ImageOps on the command line 🌱 🏞️
Stars: ✭ 255 (+133.94%)
Mutual labels:  screenshot, capture
Quickshot
Capture images of any View, SurfaceView or Bitmap from your Android app in: .jpg .png or .nomedia with simple oneliner codes.
Stars: ✭ 663 (+508.26%)
Mutual labels:  screenshot, capture
video-snapshot
Get snapshots from a video file in the browser 🎥 🌅
Stars: ✭ 63 (-42.2%)
Mutual labels:  screenshot, capture
Image Screenshot
download an image node along with its css properties
Stars: ✭ 40 (-63.3%)
Mutual labels:  screenshot, canvas
Mac2imgur
⬆ A simple Mac app designed to make uploading images and screenshots to Imgur quick and effortless.
Stars: ✭ 914 (+738.53%)
Mutual labels:  screenshot, capture
snapcrawl
Crawl a website and take screenshots
Stars: ✭ 37 (-66.06%)
Mutual labels:  screenshot, capture
Imgursniper
📷 A quick and easy Image, Screenshot and Screen recording sharing tool
Stars: ✭ 69 (-36.7%)
Mutual labels:  screenshot, capture
TakingImageOfAView
An example on how to take screenshot of a particular view
Stars: ✭ 15 (-86.24%)
Mutual labels:  screenshot, canvas
Singlefile
Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a single HTML file
Stars: ✭ 4,417 (+3952.29%)
Mutual labels:  screenshot, browser
1click-webpage-screenshot
Entire page Screenshot extension for Google Chrome. I'm developing open source extension for Google Chrome. All extension are free for use. Let's make Chrome great again!
Stars: ✭ 432 (+296.33%)
Mutual labels:  screenshot, capture
Html To Image
✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
Stars: ✭ 595 (+445.87%)
Mutual labels:  screenshot, canvas
VideoScreenRecorder
Record video of your screen and save the file locally 🎥
Stars: ✭ 36 (-66.97%)
Mutual labels:  screenshot, capture
HighlightTranslator
Highlight Translator can help you to translate the words quickly and accurately. By only highlighting, copying, or screenshoting the content you want to translate anywhere on your computer (ex. PDF, PPT, WORD etc.), the translated results will then be automatically displayed before you.
Stars: ✭ 54 (-50.46%)
Mutual labels:  screenshot, capture
X11 Recorder
xrec helps you capture any area of your screen either as a screenshot or record a gif file.
Stars: ✭ 17 (-84.4%)
Mutual labels:  screenshot, capture
Minipaint
online image editor
Stars: ✭ 1,014 (+830.28%)
Mutual labels:  browser, canvas

capture-frame travis npm downloads javascript style guide

Capture video screenshot from a <video> tag (at the current time)

Sauce Test Status

Works in the browser with browserify! This module is used by WebTorrent Desktop.

install

npm install capture-frame

usage

simple example

const captureFrame = require('capture-frame')

const frame = captureFrame('.video') // Buffer that contains .png file data

// show the captured video frame in the DOM
const image = document.createElement('img')
image.width = frame.width
image.height = frame.height
image.src = window.URL.createObjectURL(new window.Blob([frame.image]))
document.body.appendChild(image)

complete example

const captureFrame = require('capture-frame')

const video = document.createElement('video')
video.addEventListener('canplay', onCanPlay)

video.volume = 0
video.autoplay = true
video.muted = true // most browsers block autoplay unless muted
video.setAttribute('crossOrigin', 'anonymous') // optional, when cross-domain
video.src = 'http://example.com/test.mp4'

function onCanPlay () {
  video.removeEventListener('canplay', onCanPlay)
  video.addEventListener('seeked', onSeeked)

  video.currentTime = 2 // seek 2 seconds into the video
}

function onSeeked () {
  video.removeEventListener('seeked', onSeeked)

  const frame = captureFrame(video)

  // unload video element, to prevent memory leaks
  video.pause()
  video.src = ''
  video.load()

  // show the captured image in the DOM
  const image = document.createElement('img')
  image.width = frame.width
  image.height = frame.height
  image.src = window.URL.createObjectURL(new window.Blob([frame.image]))
  document.body.appendChild(image)
}

api

frame = captureFrame(video, [format])

Capture a video frame the the video tag specified by video. This can be a reference to a video element in the page, or a string CSS selector. This must refer to a video element.

Optionally, specify a format for the image to be captured in. Must be one of "png", "jpeg", or "webp".

The returned object, frame, has three properties:

frame.image

The captured image, as a Buffer.

frame.width

The captured image's width, as a number.

frame.height

The captured image's height, as a number.

license

MIT. Copyright (c) Feross Aboukhadijeh.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].