npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

video-indexer

v1.0.0

Published

Node.js wrapper for Microsoft Cognitive Services Video Indexer REST API.

Downloads

4

Readme

video-indexer

This is a Node.js wrapper for the Microsoft Cognitive Services Video Indexer API, currently in preview. Per the Video Indexer API website, its features include:

  • Convert audio to text based on acoustic language models
  • Find when each face appears in the video
  • Map and understand who spoke when
  • Extract text that appears in videos as overlay, slides or background
  • Understand who is the person that appears in the video
  • Separate background noise and voice activity
  • Detect when a scene changes based on visual analysis
  • Understand the level of positive vs. negative spoken or written content
  • Translate source audio into the language of your choice.
  • Detect and prevent explicit visual content
  • Find out the key words discussed in each segment
  • Automatically detect key frames

This Node.js module is still under development; it has been tested but is not guaranteed for production use. Issues and PRs welcome! :)

Installation

npm install video-indexer

Usage

Grab a free API key by signing up here and clicking on your account name, then "Profile." Replace "your_api_key" below with the API key for local testing.

const vindexer = require("video-indexer");
const Vindexer = new vindexer("your_api_key");

// Upload video via a URL and generate intelligent insights. If no URL is specified, the file should be passed as a multipart/form body content.
Vindexer.uploadVideo({
    // Optional
    videoUrl: "http_://_video_url_dot_/video.mp4",
    name: 'My video name',
    privacy: 'Private', 
    language: 'English', 
    externalId: 'customvideoid',
    description: 'Check out this great demo video!',
    partition: 'demos'
})
    .then( function(result){ console.log (result.body) } );

// Get full insights from previously-processed video
Vindexer.getBreakdown("your_video_id")
    .then( function(result){ console.log (result.body) } );;

More examples

Note that in the examples above and below, strings passed into functions are always required, while parameters that appear in the format of { this: 'that' } are always optional.

// Get user id and name associated with API Key
Vindexer.getAccounts()
    .then( function(result){ console.log (result.body) } );

// Get progress of video processing
Vindexer.getProcessingState("your_video_id")
    .then( function(result){ console.log (result.body) } );

// Search for videos within your own account
// If you want to test with a publicly-available dataset instead, 
// set searchInPublicAccount to true
Vindexer.search({
    // Optional
    privacy: 'Public',
    id: 'some_video_id',
    partition: 'some_partition',
    owner: 'some_owner',
    face: 'some_face',
    query: 'search_term',
    pageSize: 10,
    skip: 5,
    externalId: 'some_external_id',
    language: 'English',
    searchInPublicAccount: false
})
    .then( function(result){ console.log (result.body) } );

// Get video player widget URL
Vindexer.getPlayerWidgetUrl("your_video_id")
    .then( function(result){ console.log (result.body) } );

// Get insights widget
Vindexer.getInsightsWidgetUrl("your_video_id", {
    // Optional. Other widget types are 'People', 'Sentiment', and 'Search'. 
    // If left unspecified, the widget will include all insight types
    widgetType: 'Keywords'
})
    .then( function(result){ console.log (result.body) } );

// Get insights by external ID
Vindexer.getInsightsWidgetByExternalId("external_id")
    .then( function(result){ console.log (result.body) } );

// Get URL to VTT transcript
Vindexer.getVttUrl("your_video_id")
    .then( function(result){ console.log (result.body) } );

// Given a video ID and face ID, update the face with a name
Vindexer.updateFaceName("your_video_id", "face_id", "Person Name")
    .then( function(result){ console.log (result.body) } );

// Reindex a previously-processed video
Vindexer.reindexBreakdown("your_video_id", {
    // Optional
    callbackUrl: 'http_://_callbackurl_dot_com'
});

// Reindex a previously processed video by external ID
Vindexer.reIndexBreakdownByExternalId("external_id", {
    // Optional
    callbackUrl: 'http_://_callbackurl_dot_com'
})

// Delete video and, optionally, insights
Vindexer.deleteBreakdown("your_video_id", {
    // Optional
    deleteInsights: true
});