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

replay-ffmpeg

v1.2.3

Published

service that export useful method for ffmpeg, using the fluent-ffmpeg module.

Downloads

8

Readme

replay-ffmpeg-service

replay-ffmpeg-service is module that export some useful methods for record videos and manipulation on TS files. It uses Behind the Scenes the fluent-ffmpeg module.

###Install

  1. Install ffmpeg and ffprobe on ubuntu through this guide.
  2. run the command: npm install --save replay-ffmpeg-service

###Methods

for using the methods first require the module

var ffmpeg = require('replay-ffmpeg-service');

#####ffmpeg.convertToMp4(params)

convert ts file from file system to mp4 format. It take the file and create new file with the suffix '.mp4'

  • params | <Object>

    • inputPath | <String> the path of the file with the file name.
    • outoutPath (optional) | <String> the path of the output, default to the same path and the same name of the input file but with the suffix '.mp4'.
    • divideToResolutions (optional) | <Boolean> option if want to divide the video into different resolutions.
  • emit 'FFmpeg_errorOnConverting' when error eccured on converting.

  • emit 'FFmpeg_finishConverting' when finish the converting.

  • Return promise | <BlueBird Promise> just for the building of the command, not of the processing.


#####ffmpeg.extractData(params)

extract data from the ts file. It take the file and create new file with the suffix '.data'

  • params | <Object>

    • inputPath | <String> the path of the file with the file name.
    • outoutPath (optional) | <String> the path of the output, default to the same path and the same name of the input file but with the suffix '.data'.
  • emit 'FFmpeg_errorOnExtractData' when error eccured on extracting.

  • emit 'FFmpeg_finishExtractData' when finish the extracting.

  • Return promise | <BlueBird Promise> just for the building of the command, not of the processing.


#####ffmpeg.convertAndExtract(params)

It convert and extract data from the ts file, it combine the extractData and convertToMp4 methods. note: this method won't work if the file doesnt have both video and data streams!

  • params | <Object>

    • inputPath | <String> the path of the file with the file name.
    • outoutPath (optional) | <String> the path of the output, default to the same path and the same name of the input files but with the suffix '.mp4' and '.data'.
    • divideToResolutions (optional) | <Boolean> option if want to divide the video into different resolutions.
  • emit 'FFmpeg_errorOnConvertAndExtract' when error eccured on process.

  • emit 'FFmpeg_finishConvertAndExtract' when finish the process.

  • Return promise | <BlueBird Promise> just for the building of the command, not of the processing.


#####ffmpeg.duration(params[,callBack])

get the duration of video.

  • params | <Object>

    • filePath | <String> the path of the file with the file name.
  • callBack (optional) | <Function> The callback gets two arguments (err, duration).

  • Return Promise | <BlueBird Promise> .then(durtion) | .catch(err)

you can see that the function work both with promise or callback, that means it Asynchronous.


#####ffmpeg.record(params)

convert ts file from file system to mp4 format. It take the file and create new file with the suffix '.mp4'

  • params | <Object>

    • input | <String> the input of the record, it can be path of file or it can be brodcast streaming host.
      note: if the input is brodcast streaming host it should be in the next format: udp://[ip]:[port]
    • outout | <String> the path of the output without extension,the method will add .ts extension.
    • duration (optiona) | <Number> duration of the record in seconds, default to 1800 seconds(3 minutes).
  • emit 'ffmpegWrapper_error_while_recording' when error eccured on recording with the error.

  • emit 'ffmpegWrapper_finish_recording' when finish the record with the path of the output file.

  • Return promise | <BlueBird Promise> just for the building of the command, not of the processing.


note: this package will be change