ffmpeg -i X:\01c2f0bbcb7c03193227025410917f19.mp4 -b:v 1m X:\01c2f0bbcb7c03193227025410917f19_b_1m.mp4
-i input input path
-b:v frame rate is now 1000k which is 1m you can write 400k 500k
The lower the frame rate, the less compressed the video is. The more blurred the quality. 1000 is very clear.
specify file size
ffmpeg -i Desktop/吉他.mp4 -fs 15MB Desktop/output1.mp4
ffmpeg -i X:\01c2f0bbcb7c03193227025410917f19.mp4 -b:v 1m -fs 15MB X:\01c2f0bbcb7c03193227025410917f19_b_1m.mp4
-fs 15MB
- Indicates that the maximum file size is 15MB
Similarly, there are many properties for reference
-s vga
- -s vga : specify the resolution, vga represents 600*480, and can also be replaced with other values
List of common parameters of ffmpeg
Basic options: | |
---|---|
-formats | Output all available formats |
-f fmt | Specify the format (audio or video format) |
-i filename | Specify the input file name, of course, it can also be specified under linux: 0.0 (screen recording) or camera |
-and | overwrite existing file |
-t duration | The recording time is t |
-fs limit_size | Set the maximum file size |
-ss time_off | From the specified time (s), the format [-]hh:mm:ss[.xxx] is also supported |
-itsoffset time_off | Set the time offset (s), this option affects all subsequent input files. The offset is added to the timestamp of the input file, defining a positive offset means that the corresponding stream is delayed by offset seconds. [-]hh:mm:ss[.xxx] format is also supported |
-title string | title |
-timestamp time | timestamp |
-author string | author |
-copyright string | Copyright Information |
-comment string | Comment |
-album string | album name |
-v verbose | related to log |
-target type | set target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...) |
-dframes number | Set the number of frames to record |
Video options: | |
-b | Specify the bit rate (bits/s), it seems that ffmpeg is automatic VBR, the specified is probably the average bit rate |
-vb | Specify the video bit rate (bits/s) |
-vframes number | Set how many frames of video to convert |
-r rate | Frame rate (fps) |
-s size | Resolution |
-aspect aspect | Set video aspect ratio (4:3, 16:9 or 1.3333, 1.7777) |
-croptop size | Set the top cut size (in pixels) |
-cropbottom size | Set the bottom cut size (in pixels) |
-cropleft size | Set the left cut size (in pixels) |
-cropright size | Set the right cut size (in pixels) |
-padtop size | Set the top padding size (in pixels) |
-padbottom size | Bottom padding (in pixels) |
-padleft size | Left padding (in pixels) |
-padright size | Right padding (in pixels) |
-padcolor color | Fill with color (000000-FFFFFF) |
-vn | Cancel the video |
-vcodec codec | Force the use of codec codec ('copy' to copy stream) |
-sameq | Use the same video quality as the source (VBR) |
-pass n | Select the number of processing passes (1 or 2). Two-pass encoding is very useful. The first pass generates statistics, the second pass generates the exact requested bit rate |
-passlogfile file | The record file name selected twice is file |
-newvideo | Add a new video stream after the current video stream |
Advanced Video Options | |
-pix_fmt format | set pixel format, 'list' as argument shows all the pixel formats supported |
-intra | Intra-coded only |
-qscale q | VBR based on the quality of <number>, the value is 0.01-255, the smaller the quality, the better |
-loop_input | Set the number of loops of the input stream (currently only valid for images) |
-loop_output | Set the number of loops of the output video. For example, when outputting gif, set it to 0 to indicate infinite loop. |
-g int | Set image group size |
-cutoff int | Set cutoff frequency |
-Qmin you | set minimum quality |
-qmax int | set max quality |
-qdiff int | Maximum deviation between quantization scales (VBR) |
-bf int | Use frames B frame, support mpeg1, mpeg2, mpeg4 |
Audio options: | |
-away | Set the bit rate (unit: bit/s, maybe the old version is kb/s) |
-aframes number | Set how many frames of audio to convert |
-aq quality | Set audio quality (specify encoding) |
-ar rate | Set the audio sample rate (unit: Hz) |
-ac channels | Set the number of channels |
-an | cancel audio |
-acodec codec | Specify audio encoding ('copy' to copy stream) |
-vol volume | Set the recording volume level (default is 256) |
-newaudio | Add a new audio stream after the current audio stream |
Subtitle options: | |
-sn | Cancel subtitles |
-scodec codec | Set subtitle encoding ('copy' to copy stream) |
-newsubtitle | Add after current subtitle |
-slang code | Set the ISO 639 encoding used for subtitles (3 letters) |
Audio/Video capture options: | |
-vc channel | Set the video capture channel (only for DV1394) |
-tvstd standard | Set TV standard NTSC PAL (SEC |