
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
capture-video-frame
Advanced tools
A micro-library for taking screenshots from a running HTML5 video.
A micro-library for taking screenshots from a running HTML5 video. Built to work together with getUserMedia.js
$ npm install --save capture-video-frame
HTML:
<video id="my-video" autoplay>
<source src="movie.mp4" type="video/mp4" />
</video>
<img id="my-screenshot" />
JavaScript:
import captureVideoFrame from "capture-video-frame.js";
// When you want to record the image
const frame = captureVideoFrame("my-video-id", "png");
// Show the image
const img = document.getElementById("my-screenshot");
img.setAttribute("src", frame.dataUri);
// Upload the image...
const formData = new FormData();
formData.append("file", frame.blob, `my-screenshot.${frame.format}`);
// ...with plain JS
const request = new XMLHttpRequest();
request.open("POST", "/api/upload", true);
request.setRequestHeader(
"Content-Type",
"application/multipart/form-data; charset=UTF-8"
);
request.send(formData);
// ...or with jQuery
$.ajax({
url: "/api/upload",
method: "POST",
data: formData,
processData: false,
contentType: false,
});
Tested on current Chrome and Firefox.
captureVideoFrame(source, format, quality)source (element or string, mandatory) Source video. If string, id of the element.
format (string, optional) Output image format. Can be either png or jpeg. png is the default.
quality (number, optional) A Number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/webp. The default value is 0.92.
blob, dataUri, and format properties if the capture succeededfalse if the capture failed.Image blob can be easily uploaded to the server using XHR2 FormData API.
Image data URI can be easily set as <img> src attribute to show the captured image.
MIT
FAQs
A micro-library for taking screenshots from a running HTML5 video.
The npm package capture-video-frame receives a total of 863 weekly downloads. As such, capture-video-frame popularity was classified as not popular.
We found that capture-video-frame demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.