Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
fluent-ffmpeg
Advanced tools
The fluent-ffmpeg npm package is a powerful and flexible library for working with FFmpeg, a comprehensive multimedia processing tool. It allows you to perform a wide range of audio and video processing tasks, such as transcoding, format conversion, video editing, and more, using a fluent API.
Transcoding
This feature allows you to transcode a video from one format to another. In this example, an MP4 file is transcoded to AVI format.
const ffmpeg = require('fluent-ffmpeg');
ffmpeg('input.mp4')
.output('output.avi')
.on('end', () => {
console.log('Transcoding finished');
})
.on('error', (err) => {
console.error('Error: ' + err.message);
})
.run();
Video Editing
This feature allows you to edit videos, such as trimming a segment. In this example, a 10-second segment starting from the 10-second mark of the input video is extracted.
const ffmpeg = require('fluent-ffmpeg');
ffmpeg('input.mp4')
.setStartTime('00:00:10')
.setDuration('10')
.output('output.mp4')
.on('end', () => {
console.log('Video editing finished');
})
.on('error', (err) => {
console.error('Error: ' + err.message);
})
.run();
Audio Extraction
This feature allows you to extract audio from a video file. In this example, the audio from an MP4 video is extracted and saved as an MP3 file.
const ffmpeg = require('fluent-ffmpeg');
ffmpeg('input.mp4')
.output('output.mp3')
.noVideo()
.on('end', () => {
console.log('Audio extraction finished');
})
.on('error', (err) => {
console.error('Error: ' + err.message);
})
.run();
Adding Watermarks
This feature allows you to add watermarks to videos. In this example, a text watermark is added to the video.
const ffmpeg = require('fluent-ffmpeg');
ffmpeg('input.mp4')
.outputOptions('-vf', 'drawtext=text=Watermark:fontcolor=white:fontsize=24:x=10:y=10')
.output('output.mp4')
.on('end', () => {
console.log('Watermark added');
})
.on('error', (err) => {
console.error('Error: ' + err.message);
})
.run();
The ffmpeg npm package is a simple wrapper around the FFmpeg command-line tool. It provides basic functionality for executing FFmpeg commands but lacks the fluent API and higher-level abstractions provided by fluent-ffmpeg.
The ffmpeg-static npm package provides a static binary of FFmpeg for various platforms. It is useful for ensuring that FFmpeg is available in your environment but does not provide any API for interacting with FFmpeg commands directly.
The node-ffmpeg npm package is another wrapper for FFmpeg, offering a more straightforward API for basic tasks like transcoding and format conversion. However, it is less feature-rich and flexible compared to fluent-ffmpeg.
FAQs
A fluent API to FFMPEG (http://www.ffmpeg.org)
The npm package fluent-ffmpeg receives a total of 633,540 weekly downloads. As such, fluent-ffmpeg popularity was classified as popular.
We found that fluent-ffmpeg demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.