| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
9年前发布

Node.js的MP4流编码和解码器:mp4-stream

Node.js的MP4流编码和解码器:mp4-stream。

npm install mp4-stream

用法

var mp4 = require('mp4-stream')  var fs = require('fs')    var decode = mp4.decode()    fs.createReadStream('video.mp4')    .pipe(decode)    .on('atom', function (atom) {      console.log('found atom (' + atom.type + ') at ' + atom.offset + ' (' + atom.length + ')')      if (atom.container) {        console.log('atom has child atoms (will be emitted next)')      }      if (atom.stream) {        console.log('atom has stream data (consume stream to continue)')        atom.stream.resume()      }    })

All atoms have a type thats a 4 char string with a type name.

API

var stream = mp4.decode()

Create a new decoder.

The decoder is a a writable stream you should write a mp4 file to. The stream will emitatomwhen a new atom is found.

var stream = mp4.encode()

Create a new encoder.

Currently not implemented

项目主页:http://www.open-open.com/lib/view/home/1446711537482

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1446711537482.html
多媒体处理 mp4-stream