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

substract-cli

v1.2.0

Published

CLI for using the substract library.

Downloads

375

Readme

substract-cli

wakatime Node.js CI GitHub License GitHub Release Size typescript

substract-cli is a command-line interface built to interact with the substract library, which enables efficient extraction of hard-coded subtitles from video files. This CLI leverages the substract library's powerful OCR-based subtitle extraction features, making it straightforward to integrate with video processing workflows directly from the command line.

Table of Contents

  • Features

  • Installation

  • Usage

  • Commands

  • Options

  • Requirements

  • License

Features

  • Subtitle Extraction: Retrieves embedded subtitles from video files using OCR technology.
  • User-Friendly CLI: Simplified commands to streamline the subtitle extraction process.
  • Configurable Options: Control extraction parameters such as frame frequency, duplicate text filtering, and OCR paths directly through CLI options.
  • Enhanced Logging: Real-time feedback on extraction progress, including OCR and frame processing.
  • Popular Platforms: Supports Facebook, X (formerly Twitter), YouTube links.

Installation

To install the Substract CLI, ensure you have Node.js version 20.0.0 or later.

npm install -g substract-cli

Or

npx substract-cli

Or

bunx substract-cli

Usage

To use the CLI, run the following command with the required arguments:

substract-cli [options]

Example:

substract-cli path/to/video.mp4 --output path/to/output.json --frequency 5

# outputs 123456.txt
substract-cli "https://www.facebook.com/watch/?v=123456"

# outputs TKdI.txt
substract-cli "https://www.youtube.com/watch?v=TKdI"

substract-cli "https://x.com/user/status/13245"

Options

| Option | Type | Description | | --------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --apple-binary-path | string | The path to the OCR engine compiled for the Apple environment. If this is set at least once, the cli will reuse this value next time even if it is not provided. You can get a copy from here. | | --concurrency | number | The number of threads to use to process the OCR. | | --frequency | number | The frequency in seconds after which to extract a frame for subtitles. | | --bottom | number | The number of pixels from the bottom of the video to crop to extract the subtitles. | | --top | number | The number of pixels from the top of the video to crop to extract the subtitles. | | --left | number | The number of pixels from the left of the video to crop to extract the subtitles. | | --right | number | The number of pixels from the right of the video to crop to extract the subtitles. | | --output-file | number | The output file to write the extracted subtitles to. This can have a .json or .txt extension. If this is omitted, the output file will be a .txt file in the same directory as the input. |

Requirements

  • Node.js v20.0.0+

License

Licensed under the MIT License.