FFmpeg introduction and parameter description

Source: Internet
Author: User

FFmpeg is an open-source, free, cross-platform video and audio stream solution. It is a free software and uses lgpl or GPL licenses (based on the components you choose ). It provides a complete solution for recording, conversion, and streaming audio and video. It contains a very advanced audio/video codec library libavcodec. To ensure high portability and CODEC quality, many codec libraries in libavcodec are developed from scratch.

FFmpeg is developed on Linux, but it can also be compiled and run in other operating system environments, including Windows and Mac OS X.

The FFMPEG project consists of the following parts:
The command line tool for converting FFMPEG video files also supports capturing and encoding video files through real-time video cards.
Ffserver is a multimedia server used for real-time broadcast based on HTTP (RTSP is under development) and supports time translation.
Ffplay is a simple media player developed using SDL and FFMPEG libraries.
Libavcodec is a library that contains all FFMPEG audio and video codecs. To ensure optimal performance and high reusability, most codecs are developed from scratch.
Libavformat is a library that contains all the normal audio and video formats and generators.

 

 

Example: FFmpeg-y-I "1.avi"-title" test "-vcodec XviD-s 368x208-r 29.97-B 1500-acodec AAC-AC 2-ar 24000-AB 128-Vol 200-f psp-muxvb 768 "output. WMV"

Explanation: The preceding commands can be entered in the doscommand line or created to run in a batch file. However, the premise is that it should be executed in the directory where FFmpeg is located (the cores subdirectory under the directory where conversion is located ).

 

 

The input and output files are usually multimedia files to be processed. It can be pure audio files, pure video files, or mixed files. Most common formats can be used to "kill ". Similar to common MPEG, Avi-encapsulated DivX and Xvid, you can use FFMPEG-formats to view the supported formats or directly view the documents.
In addition, because Linux regards a device as a file, the-I option can be followed by the device name. Such as DV, video card, optical drive, or other devices.


Parameters:

 

-Y overwrites the output file, that is, if the output. WMV file already exists, it will be overwritten without prompt.
-I "1.avi": the input file is a 1. AVI file in the same directory as FFMPEG. You can add the path and change the name.
-Title "test": the title of the video displayed in PSP
-Vcodec Xvid: Uses Xvid encoding to compress the video. It cannot be changed. The corresponding library is libxvid.
-S 368x208: the output resolution is 368x208. Note that the source must be or not.
-R: 29.97 frames. This is generally used.
-B: 1500 of the video data traffic. Use the-B XXXX command to use a fixed bit rate. The number can be changed as needed. The value above 1500 does not work. Dynamic bit rates can also be used, for example: -The quality of qscale 4 and-qscale 6 is higher than that of 6.
-The library corresponding to AAC for acodec AAC audio encoding is libfaac
-AC 2 channels: 1 or 2
-The sampling frequency of AR 24000 sound, as if PSP only supports 24000Hz
-AB 128 audio data traffic, generally 32, 64, 96, and 128
-Change the volume of Vol 200 to 200%.
-Muxvb 768 seems to be the bit rate recognized by PSP machines. Generally, it is set to 384, 512, and 768. if I change it to 1500, PSP will say the file is damaged.
-F psp output PSP special format
"Output. wmv" output file name. You can also add a path to change the file name.


Example 1:
Take an image of the 352x240 size in JPG format:
FFmpeg-I test. ASF-y-F image2-T 0.001-s 352x240 a.jpg

Example 2:
Convert the first 30 frames of the video into an animation GIF:
FFmpeg-I test. ASF-vframes 30-y-F GIF a.gif

Example 3:
Crop a 8.01*352 thumbnail at the second of the video
FFmpeg-I test2.asf-y-F image2-SS 08.010-T 0.001-s 352x240 B .jpg

 

 

 

 

A) General options

-L license

-H help

-Fromats displays available formats, codec, and protocols...

-F fmt forced the FMT Format

-I filename input file

-Y overwrites the output file

-T Duration: the recording time in HH: mm: ss [. xxx] format is also supported.

-SS position: the specified time [-] hh: mm: ss [. xxx] format is also supported.

-Title string: Set the title

-Author string: Set the author.

-Copyright string sets Copyright

-Comment string: Set comments.

-Target type: All the format options (bit rate, codec, and buffer size) of the target file type (VCD, SVCD, and DVD) are automatically set. You only need to enter the following parameters:
FFmpeg-I myfile. Avi-target VCD/tmp/VCD. mpg

-HQ activates high-quality settings

-Itsoffset offset is set to the Time Offset Based on seconds. This option affects all subsequent input files. This 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

B) video options

-B bitrate: bit rate. The default value is kb/s.

-R fps: the default frame rate is 25.

-S size: Set the frame size format to WXH. The default value is 160x128. The following can also be used directly:
Sqcif 128x96 qcif 176x144 CIF 252x288 4cif 704x576

-Set aspect to or 1.3333 1.7777

-Croptop size: Specifies the size of the top part in pixels.

-Cropbottom size-cropleft size-cropright size

-Padtop size: set the size pixel unit filled at the top.

-Padbottom size-padleft size-padright size-padcolor color: Fill in the color (Hex, six hexadecimal numbers, Red: Green: blue, for example, 000000 indicates black)

-VN does not record videos

-BT tolerance: sets the video bit rate tolerance kbit/s.

-Maxrate bitrate: sets the maximum video bit rate tolerance.

-Minrate bitreate: sets the minimum video bit rate tolerance.

-Bufsize size: sets the bit rate to control the buffer size.

-Vcodec codec enforces codec encoding/decoding. If copy is used, the original codec data must be copied.

-Sameq uses the same video quality as the source (VBR)

-Pass N: Number of processing times (1 or 2 ). Two-time encoding is very useful. Statistical information is generated for the first time, and precise request bit rate is generated for the second time.

-Passlogfile: Select File as the record file twice.


C) advanced video options

-G gop_size: Set the image group size.

-Intra only applies to intra-frame encoding.

-Qscale Q uses a fixed video Quantization Scale (VBR)

-Qmin Q minimum video Quantization Scale (VBR)

-Qmax Q maximum video Quantization Scale (VBR)

-Maximum deviation between qdiff Q quantization scales (VBR)

-Qblur: Video quantization Scaling (VBR)

-Qcomp compression video Quantization Scale compression (VBR)

-The initial complexity of rc_init_cplx complexity Encoding

-B _qfactor: QP factor between P and B frames

-The QP factor of I _qfactor between P and I frames

-QP deviation of B _qoffset offset between P and B frames

-QP deviation of I _qoffset offset between P and I frames

-Rc_eq equation: sets the default bitrate control equation Tex ^ qcomp.

-Rc_override: speed control overload at a specific interval

-Me method: the available methods for setting motion estimation are zero phods log X1 EPZs (default) full

-Dct_algo algo: the default DCT 1 ff_dct_fastint 2 ff_dct_int 3 ff_dct_mmx 4 ff_dct_mlib 5 ff_dct_altivec can be used to set the DCT algorithm.

-Idct_algo algo: sets the IDCT algorithm. There are 0 ff_idct_auto default IDCT 1 ff_idct_int 2 ff_idct_simple 3 limit 4 limit 5 ff_idct_ps2 6 ff_idct_mlib 7 ff_idct_arm 8 limit 9 limit 10 ff_idct_simplearm

-Er N is set to N 1 ff_er_carefull default 2 ff_er_compliant 3 ff_er_aggressive 4 ff_er_very_aggressive

-EC bit_mask: sets an error mask to bit_mask. This value is the bit mask of the following value: 1 ff_ec_guess_mvs (default = enabled) 2 ff_ec_deblock (default = enabled)

-BF frames uses frames B frames and supports mpeg1, MPEG2, and MPEG4

-Mbd mode macro block decision 0 ff_mb_decision_simple use mb_cmp 1 ff_mb_decision_bits 2 ff_mb_decision_rd

-4mv: use four motion vectors for MPEG4 only

-Part uses data division only for MPEG4

-Bug Param bypass is not automatically detected with the Encoder

-Strict strictness and standard rigor

-AIC enables advanced in-frame encoding h263 +

-Umv enables infinite Motion Vector h263 +

-Deinterlace

-Interlace forced interlace encoding is only valid for MPEG2 and MPEG4. This option is used when your input is intertwined and you want to stay intertwined to minimize image loss. The optional method is not intertwined, but the loss is greater.

-Calculate the SNR of the compressed frame.

-Vstats outputs video encoding statistics to vstats_hhmmss.log

-The vhook module inserts a video processing module. The module name and parameters are separated by spaces.

D) Audio options

-AB bitrate: Set the audio bit rate.

-Ar freq: Set the audio Sampling Rate

-AC channels: Set the channel to 1 by default.

-An does not enable audio recording

-Acodec codec uses codec encoding/Decoding

E) audio/video capture options

-VD device: sets the video capture device. For example,/dev/video0

-VC channel: Specifies the dedicated video capture channel dv1394.

-Tvstd standard: sets the TV standard NTSC pal (SECAM)

-Set dv1394 to capture dv1394

-AV device: Set audio devices such as/dev/DSP


F) advanced options

-Map File: stream sets the input stream ing.

-Debug: Print specific debugging information

-Benchmark indicates the benchmark test time.

-Hex dumping each input package

-Bitexact only uses a bit Precise Algorithm for Codec testing.

-PS size: Set the package size, in bits.

-Re reads data at a local frame rate, which is mainly used to simulate capturing devices.

-Loop input stream. Only works on image streams for ffserver Testing

FFmpeg introduction and parameter description

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.