1. video/audio format conversion
FFmpeg can use any supported formats and protocols as input:
* For example, you can enter the YUV file: FFMPEG-I/tmp/test % d. Y/tmp/out. mpg.
It will use the following file:
/Tmp/test0.y,/tmp/test0.u,/tmp/test0.v,
/Tmp/test1.y,/tmp/test1.u,/tmp/test1.v, etc...
* You can enter the original yuv420p file: FFMPEG-I/tmp/test. YUV/tmp/out. Avi
The original yuv420p file contains the original YUV polarity. Each frame starts at the Y plane and follows the u and v planes. They are half the horizontal vertical resolution of the Y plane.
* You can output the original yuv420p file.
FFmpeg-I mydivx. Avi-O hugefile. YUV
* You can set several input and output files.
FFmpeg-I/tmp/a.wav-s 640x480-I/tmp/a. YUV/tmp/a. mpg
Upload the command line to convert the Audio Frequency File a.wav and the original YUV video file a. YUV to the mpeg file a. MPEG.
* You can also Convert audio and video
FFmpeg-I/tmp/a.wav-ar 22050/tmp/a. MP2
Upload the command line to convert the.wav sample rate to Hz and encode it as MPEG audio
* You can also encode data in several formats and establish a ing between the input stream and the output stream.
FFmpeg-I/tmp/a.wav-AB 64/tmp/a. MP2-AB 128/tmp/B. MP2-map 0: 0-map 0: 0
The command line above converts a 64 kbits a.wav to A. MP2 '-map file: Index' of kbits to define that the input stream is used for each output stream in the order of the output stream,
Vob for transcoding and decryption:
FFmpeg-I snatch_1.vob-F Avi-vcodec MPEG4-B 800-G 300-BF 2-acodec MP3-AB 128 snatch. Avi
The above command line will convert the vob file into an AVI file, MPEG4 video and MP3 audio. Note that the command uses B frames, so the MPEG4 stream is divx5 compatible. The GOP size is 300, which means that there is an intra frame every 10 seconds at a 29.97 frame rate. This ing is particularly useful in Audio-language DVD transcoding.
2. Use the FFMPEG syntax
FFmpeg [[Options] ['-I' input_file]... {[Options] output_file }...
If there is no input file, video/audio capturing will take effect.
As a general rule, the option is generally used for the next specific file. If you select-B 64, the next video rate will be set. The format option may be required for the original input file.
By default, FFMPEG tries to achieve lossless conversion as much as possible and uses the same audio and video parameters as the input.
3. Options
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: sets the DCTAlgorithmAvailable 0 ff_dct_auto default DCT 1 ff_dct_fastint 2 ff_dct_int 3 ff_dct_mmx 4 ff_dct_mlib 5 ff_dct_altivec
-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