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

jv4-demuxer

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jv4-demuxer

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

  • 1.0.9
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

介绍

基于 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);
    },
  })
);

FAQs

Package last updated on 09 Nov 2023

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