FFmpeg command: from beginner to proficient | ffmpeg command parameter description
FFmpeg command: from beginner to proficient | ffmpeg command parameter description
This section mainly introduces the common parameters of the ffmpeg command.
The main parameters
project | illustrate |
---|---|
-i | Set input stream |
-f | Set output format (format) |
-ss | Starting time |
-t | length of time |
Audio parameters
project | illustrate |
---|---|
-aframes | Set the number of audio frames to output |
-b:a | Audio bit rate |
-ar | Set audio sample rate |
-ac | Set the number of sound channels |
-acodec | Set the sound codec. If copy is used, it means that the original codec data must be copied. |
-an | Does not process audio |
-of | audio filter |
Example:
ffmpeg -i test.mp4 -b:a 192k -ar 48000 -ac 2 -acodec libmp3lame -aframes 200 out2.mp3
Video parameters
project | illustrate |
---|---|
-vframes | Set the number of video frames to output |
-b or -b:v | Set video bitrate |
-r | Set frame rate |
-s | Set the width and height of the screen |
-vn | Not processing video |
-aspect aspect | Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777) |
-vcodec | Set the video codec. If copy is used, it means that the original codec data must be copied. |
-vf | video filter |
Example:
ffmpeg -i test.mp4 -vframes 300 -b:v 300k -r 30 -s 640*480 -aspect 16:9 -vcodec libx265 out3.h265
More references
ffmpeg official documentation: ffmpeg Documentation