npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ffmpeg-node-capture

v1.1.72

Published

Node package with ffmpeg bindings.

Downloads

4

Readme

Node package with ffmpeg bindings.

Note

  • Add #define AUDIO_MIX_DEV macro in src/FFmpefCaptureWrapper.h#L25 into the Audio Mix Dev mode, otherwise cancel!
  • crop 裁剪的尺寸中 width 和 height 必须都是 16 的倍数(mac要求,win待测试)
  • crop 裁剪的尺寸
    • 对于 windows 版, width 和 height 必须是 4 的倍数, 以左上为O点,向右为x轴正方向,向下为y轴正方向
    • 对于 mac 版 , width 和 height,必须是 16 的倍数,以左下为O点,向右为x轴正方向,向上为y轴正方向(已在代码中转换为和windows一致等坐标系)

Dependency

  • Node >= 7.0.0
  • node-gyp
    • sudo npm install node-gyp
  • Virtual device driver
    • screencapturer for windows
    cd drivers/screencapturer
    ./install.bat
    • Soundflower-2-0b2.dmg for OSX
      1. cd drivers/soundflower && bash ./install.sh
      2. open "Audio MIDI Setup"
      3. http://www.jianshu.com/p/a8ff665285de

Compile

cd /path/to/ffmpeg-node-capture
node-gyp configure
node-gyp build

# publish
npm version patch
npm publish
git push

#http://192.168.0.113:4873/#/
#在这里看ffmpeg-node-capture已经1.0.10,就说明好了

Features

  • Capture Webcam.
  • Capture Display.
  • Overlay display and webcam.
  • Capture Microphone.
  • Capture System Sound.

Basic Usage

const ffmpegCapture = require('ffmpeg-node-capture');
const attached = ffmpegCapture.Display.attach();


ffplay -f rawvideo -pixel_format yuv420p -video_size 1024x768 -i display-1024x768.yuv
ffmpeg -hide_banner  -f avfoundation -list_devices true -i ""

Options

  • outputWidth: 320
  • outputHeight: 240
  • mode: 'webcam'
  • framerate: 15
  • webcam
    • deviceName: "",
    • deviceIndex: 0,
    • pixelFormat: "",
    • framerate: 15,
    • width: "",
    • height: ""
    • forceDisplayRatio: false
  • display
    • offsetX: 0,
    • offsetY: 0,
    • cropWidth: 0,
    • cropHeight: 0,
    • scaleFactor: 1 // can not greater than 1.
    • displayIndex: 0
    • framerate: 15,
    • pixelFormat: ""
    • width: "",
    • height: "",
    • captureCursor: false,
    • captureClick: false // mac only.
    • forceDisplayRatio: false
  • overlay
    • webcamX:
    • webcamY:
    • webcamWidth:
    • webcamHeight:

API

FFmpegCaptureWrapper.listWebcam(): list all webcams, and their capability.
[
  {"name": "", "capabilities": [{maxFramerate: 30, minFramerate: 15, width: 320, height: 240, pixelFormat: "yuyv422"} ...]}
]
FFmpegCaptureWrapper.listDisplay(): list all displays, and their capability.
[
  {"name": "", "capabilities": [{width: 320, height: 240, pixelFormat: "yuyv422"} ...]}
]
new FFmpegCaptureWrapper():

create a ffmpeg capture stream.

stream.open([options]):

open capture stream.

stream.close():

close capture stream.

stream.update([options]):

update options.

open event (data, width, height):

emit when stream opened successfully.

error event (err) :

emit when something wrong.

close event:

emit when close stream.