Fluent-ffmpeg Common functions

Source: Internet
Author: User

Recent projects frequently use fluent-ffmpeg to summarize the functions currently in use.

First introduce the Fluent-ffmpeg module:

var ffmpeg = require (' fluent-ffmpeg ');

1. Function Ffmpeg.ffprobe

Ffmpeg.ffprobe viewing audio Video file information and outputting it as JSON format

Format contains information such as bit rate, duration, file size, etc.

Streams, which contains video audio information details, typically two stream values.

2 Changing file properties

Save to save the file, change the source file properties.

Inputfps (25) can change the frame rate;

Seek (10) Set start time, save starting from 10s;

Duration (10) Set the total length;

Input ("Work/music/enya-one by One.mp3") can merge audio;

Aspect ("16:9") sets the video aspect ratio;

Withsize (' 1600x900 ') set the video width to high;

Withsize (' 1600x? '). Aspect (' 12:8 '). Autopad (); After you set the scale, the wide height value can be set to just one value. Autopad will fill up

3 Compositing a picture video

Save the picture in the format you want by pressing the rule input to FFmpeg

var proc = ffmpeg (' work/video/0000/frame%d.png '). Inputfps. Save (' Work/music/target.avi ');

4 Merging Videos

var file1 = "1.mp4";
var file2 = "2.mp4";
var Outpath = "Out.mp4";
var proc = ffmpeg (file1)
. Input (File2). Mergetofile (Outpath);

Fluent-ffmpeg Common functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.