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