1.1.0 • Published 6 months ago

jv4-demuxer v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

介绍

基于 Stream 流式编程的流解封装模块

使用

import { FlvDemuxer } from "jv4-demuxer";
import OPut from "oput";
const oput = new OPut();

const demuxer = new FlvDemuxer();
demuxer.demux(oput);
// 读取数据
const inputPipe = new ReadableStream({
  start(controller) {
    conn.onmessage = (evt) => {
      controller.enqueue(evt.data);
    };
  },
}).pipeTo(new WritableStream(oput));

// 视频可读流
const videoOuput = demuxer.videoReadable.pipeTo(
  new WriteableStream({
    write(chunk: EncodedVideoChunkInit) {
      console.log("video", chunk);
    },
  })
);

// 音频可读流
const audioOuput = demuxer.audioReadable.pipeTo(
  new WriteableStream({
    write(chunk: EncodedAudioChunkInit) {
      console.log("audio", chunk);
    },
  })
);
1.1.0

6 months ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago