Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spencerjibz/video_compression
Video compression nodejs
https://github.com/spencerjibz/video_compression
ffmpeg fluent-ffmpeg nodejs worker-threads
Last synced: 3 months ago
JSON representation
Video compression nodejs
- Host: GitHub
- URL: https://github.com/spencerjibz/video_compression
- Owner: spencerjibz
- Created: 2022-10-12T15:16:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-15T10:55:09.000Z (5 months ago)
- Last Synced: 2024-09-15T13:03:32.237Z (5 months ago)
- Topics: ffmpeg, fluent-ffmpeg, nodejs, worker-threads
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Video transcoding nodejs
Simple tutorial of video transcoding with [fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg).### Requirments
- Nodejs versions with worker_threads & esmodule support
- ffmpeg ;
- ***Optional:*** Hardware acceleration requirements (Nvidia GPU with nvenc support Or Apple Silicon devices)### Features
- h264 compression with a crf of 28,
- Both single thread(singlethreaded.js) and multi-thread workloads(index.js&)
- Resizing to any resolution (when provided an array of resolutions)
- Conversion to mp4
- Hardware accelerated video compression with cuda support(using h264_nevc) && videotool box for Mac### usage
**Note:**
- Before testing, create a folder named compressed in the root directory.
- For GPU acceleration, follow the instructions [here](https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/) to add hardware acceleration support to ffmpeg. (Nividia only).1. single threaded
```bash
node singlethreaded.js [InputFilenamewithExt]```
2. Multithreaded workload.```bash
node index.js [InputFilenamewithExt]```
3. Clean up the example out files
```sh
./cleanup.sh
```
4. Compare video file sizes of original and compressed;
```bash
./checkVideoSize.sh
```#### The End
thanks