Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eyevinn/autovmaf

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eyevinn/autovmaf

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by900%
Maintainers
4
Weekly downloads
 
Created
Source

Logo

autovmaf - A toolkit to automatically encode multiple bitrates and perform automated VMAF measurements on all of them.

Report a Bug · Request a Feature

license license license

PRs welcome made with hearth by Eyevinn

By optimizing ABR-ladders for specific content, you will make sure to not have wasteful rungs and this has been shown to cut bandwidth usage in half.

Usage

Only possible to run in AWS at the moment. You will need a running ECS cluster with a task definition configured to run easyvmaf-s3.

Installation

npm install --save @eyevinn/autovmaf

Run tests

npm test

Environment Variables

A few environment variables can be set. These are:

LOAD_CREDENTIALS_FROM_ENV=true   //Load AWS credentials from environment variables
AWS_REGION=eu-north-1
AWS_ACCESS_KEY_ID=ABCD...
AWS_SECRET_ACCESS_KEY=EFGH...

Generate VMAF measurements

To generate VMAF measurements, you will need to define a job which can be created with the createJob()-function.

  const { createJob, qualityAnalysisModelToString } = require('@eyevinn/autovmaf');
 
  const vmafScores = await = createJob({
    name: "MyVMAFmeasurements",
    pipeline: "pipeline.yml",
    encodingProfile: "profile.json",
    reference: "reference.mp4",
    models: ["HD", "PhoneHD"],                       // optional
    resolutions: [{ width: 1280, height: 720 }],     // optional
    bitrates: [600000],                              // optional
    method: "bruteForce"                             // optional
  });

When creating a job, you can specify:

  • Name
    • This will name the folder in which to put the files.
  • Pipeline
    • Path to a YAML-file that defines the pipeline. See examples/pipeline.yml for an example AWS-pipeline. Currently only AWS is supported.
  • Encoding Profile
    • Path to a JSON-file that defines how the reference should be encoded. When using AWS, this is a MediaConvert configuration. For local pipelines, this is key-value pairs that will be passed as command line arguments to FFmpeg. See an example for AWS at examples/encoding-profile.json.
  • Reference
    • Path to the reference video to analyze. Normally a local path, but when using AWS, this can also be an S3-URI.
  • Models (optional)
    • A list of VMAF-models to use in evaluation. This can be HD, MobileHD and UHD. HD by default.
  • Resolutions (optional)
    • A list of resolutions to test. By default it will test all resolutions in the example ABR-ladder provided by Apple in the HLS Authoring Spec.
  • Bitrates (optional)
    • A list of bitrates to test. By default a list of bitrates between 150 kbit/s to 9000 kbit/s.
  • Method (optional)
    • The method to use when analyzing the videos. Either bruteForce or walkTheHull. By default bruteForce. NOTE: walkTheHull is not implemented at the moment.

Create job using yaml

const { createJob, JobDescription } = require('@eyevinn/autovmaf');
const YAML = require('yaml');
const fs = require('fs');
const parseResolutions = resolutions => {
resolutions.map(resolutionStr => ({
   width: parseInt(resolutionStr.split('x')[0]),
   height: parseInt(resolutionStr.split('x')[1]),
  }));
};
const jobFile = fs.readFileSync('job.yml', 'utf-8');
const jobData = YAML.parse(jobFile);
const job = {
  ...jobData,
  resolutions: jobData['resolutions'] !== undefined ?rseResolutions(jobData['resolutions']) : undefined,
};
createJob(job);

An example of creating a job from a YAML-file can be seen in the examples-folder.

Read VMAF-scores

Using getVmaf(), you can read VMAF-scores from a JSON-file or a directory of JSON-files. This works on both local paths as well as S3-URIs with a "s3://"-prefix.

Example:

const vmafFiles = await getVmaf('s3://path/to/vmaf/');

vmafFiles.forEach(file => {
  console.log(file.filename + ': ' + file.vmaf);
});

About Eyevinn Technology

Eyevinn Technology is an independent consultant firm specialized in video and streaming. Independent in a way that we are not commercially tied to any platform or technology vendor.

At Eyevinn, every software developer consultant has a dedicated budget reserved for open source development and contribution to the open source community. This give us room for innovation, team building and personal competence development. And also gives us as a company a way to contribute back to the open source community.

Want to know more about Eyevinn and how it is to work here. Contact us at work@eyevinn.se!

Keywords

FAQs

Package last updated on 04 May 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc