Giter Club home page Giter Club logo

video_indexing_nodejs's Introduction

Video_Indexing_Nodejs

Nodejs wrapper for Microsaft Azure's Video Indexer API

Features

  • Upload Videos though URL to Microsoft's Video Indexer API.
  • Get Insights about the video
  • Get Information about Sentimenta, faces , Characters ,transcipts
  • Captions from videos
  • Thumbnails of videos in "JPEG" or "Base64" .
  • Error handling.

(More Functionality To Be Added Soon-under development)

Loading and configuring the module

// CommonJS
const VideoIndexer = require('./Video_indexer/index');

// ES Module
import VideoIndexer from './Video_indexer/index';

Prerequisite

Before Starting to use need you will need to get and store the belowe mentioned stuffs:

  1. Login to https://api-portal.videoindexer.ai/developer and get the Subscription Key
  2. Go to https://www.videoindexer.ai/settings/account and get the Account Id and loacation
  3. Store the keys somewhere.

Usage

1) Initialization

// Basic configuration
const Subscription_Key="Your-subscription-key";
const Account_Id="Your-Azure's-account-Id";
const Location="Your-location(Example:'trail')"
// Instantation
const vi = new VideoIndexer(Subscription_Key ,Account_Id ,Location)

2) Uploading Video :

Any video can can be uploaded through its URL. After Successfull upload ,promise iis returned which can be resolved to get videoId . This Id received can be used to get other information from video.

Note:

Only HTTPS Video URL is supported (HTML or any other types are not supported)

// Uploading video
vi.upload_video_to_indexer({
    videoUrl:"Url(https) of the video to upload" // Compulsory,
    language:"English or any other", // Optional(Default:"English"),
    name:"video-name" // Optional
})
.then(res=>{
    console.log("Video Id:",res.videoId)
})
.catch(err=>{
    console.log(err.response.data)
})

3) Getting Video Indexing Information

// Getting info
vi.get_video_index({
    videoId:"Uploaded video's Id", // Required
    language: "English or any other", // Default : English
    })
.then(data=>{
    console.log(data)
    // Processing Progress :
    console.log(data.videos[0].processingProgress)// 80% ..100%
    })
    .catch(err=>{
            console.log(err.response.data)
    })

Note :Insights won't be generated untill video is processed completely(In case uploading and getting index are called back to back).

4) Getting video captions:

vi.get_video_caption({
    videoId:"Uploaded video's Id", // Required
    format:"vtt or txt or csv or srt " // Default: vtt
    language: "English or any other", // Default : English
})
.then(res=>{
    console.log(res.data)
})
.catch(err=>{
      console.log(err.response.data)
})

5) Getting video Thumbnails:

vi.get_video_thumbnails({
    videoId:"Uploaded video's Id", // Required
    format:" jpeg || base64" // Default:jpeg
})
.then(res=>{
    console.log(res.data)
})
.catch(err=>{
      console.log(err.response.data)
})

video_indexing_nodejs's People

Contributors

jaypajji4444 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.