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

ali-mps

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ali-mps

aliyun mps nodejs sdk

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

阿里云媒体处理服务(MPS)

现阶段只实现部分音频相关的 API !!!
Only implemented some audio transcode API now!!!

Usage

const MediaProcessService = require('ali-mps');

const mps = new MediaProcessService({
  endpoint: 'https://mts.cn-hangzhou.aliyuncs.com',
  accessKeyId:'<your access key id>', 
  accessKeySecret:'<your access key secret>', 
  pipelineId:'<your pipeline id>', 
});

async function main() {
  let resp;
  
  resp = await mps.submitMediaInfo().input({bucket:'...', location:'...', object:'...'});
  console.log(resp.statusCode);
  console.log(JSON.stringify(resp.body, null, 2));
  
  resp = await mps.submit()
    .input({bucket:'...', location:'...', object:'...'})
    .output({bucket:'...', location:'...', object:'...'})
    .templateId('...')
    .format('mp3')
    .audio({
      codec: 'AAC', 
      profile: 'aac_low', 
      channels: 2, 
      bitrate: 8, 
      samplerate: 44100,
    })
    .volume({method: 'dynamic'})
    .priority(6);
  console.log(resp.statusCode);
  console.log(JSON.stringify(resp.body, null, 2));
  
  resp = await mps.list()
    .startTime('2019-01-01 12:00:00')
    .endTime('2019-01-02 12:00:00');
  console.log(resp.statusCode);
  console.log(JSON.stringify(resp.body, null, 2));
  
  resp = await mps.query().jobId('<oneJobId>');
  console.log(resp.statusCode);
  console.log(JSON.stringify(resp.body, null, 2));
  
  resp = await mps.cancel().jobId('<oneJobId>');
  console.log(resp.statusCode);
  console.log(JSON.stringify(resp.body, null, 2));
  // ...
}

main()

Keywords

FAQs

Package last updated on 05 Mar 2019

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