Detailed description of mencoder and FFMPEG Parameters

Source: Internet
Author: User
Tags flv file
Detailed description of mencoder and FFMPEG Parameters

Mencoder to FLV mencoder-ffourcc flv1-memory-of lavf-oacmp3lame-lameopts AQ = 9: CBR: Br = 64: Vol = 2-OVC lavc-lavcoptsvcodec = FLV: vbitrate = 200: acodec = MP3: abitrate = 56-vfscale = 320: 270, expand = 320: 270: 1, crop = 320: 270: 0: 0-ofps 18-srate 22050input. xxx-O output. FLV mencoder to Avi mencoder.exe-OAC mp3lame-lameopts AQ = 7: CBR: Br = 64-srate 32000-vfscale = 220: 176-OVC lavc-ffourcc dx50-lavcoptsvcodec = MPEG4: vbitrate = 320 "input. XXX "-o" output. avi "mencoder .. \ v \ WMV. WMV-o .. \ v \ wmv-3.flv-of lavf-OAC mp3lame-lameoptsabr: Br = 56-srate 22050-OVC lavc-lavcoptsvcodec = FLV: vbitrate = 500: mbd = 2: mv0: trell: v4mv: White: last_pred = 3 mencoder-OAC mp3lame-lameopts AQ = 7: CBR: Br = 64-srate 32000-vfscale = 220: 176-OVC lavc-ffourcc dx50-lavcoptsvcodec = MPEG4: vbitrate = 320 "input. XXX "-o" output. avi "mencoder-OAC mp3lame-lameopts AQ = 7: CBR: Br = 64-srate 22050-vfscale = 320:-3-OVC XviD-xvidencopts bitrate = 600" WMV. WMV "-o" WMV. avi"
Mencoder-OAC lavc-lavcopts acodec = MP2: abitrate = 64-srate 22050-VF scale = 320:-3-ofps 15-OVC XviD-xvidencopts bitrate = 400 rmvb. rmvb-O rmvb. avi mencoder 1. rmvb-OAC mp3lame-lameopts preset = 64-OVC XviD-xvidencopts bitrate = 600-of Avi-O rmvb. avi rmvb to flvcode mencoder-VF scale = 320: 240-ffourcc flv1-of lavf-lavfoptsi_certify_that_my_video_stream_does_not_use_ B _frames-OVC lavc = FLV: vbitrate = 200-srate 22050-OAC lavc-lavcoptsacodec = MP3: abitrate = 56 OK \ 1. rmvb-o OK \ rmvb. using the two FFMPEG parameters, FLV can control FFMPEG to split a large video into many small pieces of independently played files. -SS time_off set the Start Time Offset-T duration set the recording time mencoder cut-off parameter:-SS 0-endpos 120 FFMPEG to 3GP: FFMPEG-y-I **. **-Ac 1-acodec amr_nb-ar 8000-AB 24-s 128x96 [-vcodec MPEG4]-B 40 k-R 8 **. 3GP FFMPEG to FLV: FFMPEG-I inputfile. xxx-AB 56-ar 22050-qmin 2-Qmax 16-B 320 k-R 15-s 320x240 outputfile. flv ffmpeg parameter for video files:
FFmpeg-I XXX. XXX-y-F image2-SS 8-T 0.001-s 350x240 xxx.jpg
For existing FLV: FFMPEG-I XXX. FLV-y-F image2-SS 8-T 0.001-s 350x240 xxx.jpg converts the first 30 frames of the video into a GIF: FFMPEG-I XXX. xxx-vframes 30-y-f gif xxx.gif: the watermark parameter for the FFMPEG fragment that lasts for 10 seconds from 10 seconds: FFMPEG-I inputfile. xxx-tagpict ": 220: 210"-AB 56-ar 22050-qmin 2-Qmax 16-B 320 k-R 15-s 320x240 outputfile. FLV watermark parameter description:-tagpict ": 220: 210"
(Find 0002 in the directory where FFmpeg is located. mjpg, mask. two image files used as watermarks for processing are then added to each clip of the video file during transcoding at the specified coordinates, for example, 220: 210) avisynth Watermarking: First FFMPEG/mencoder compilation needs -- enable-avisynth; conversion parameter: FFMPEG-y-I 1.avs-B 320 k rmvb-avs.flv 1. AVS format: Video = directshowsource ("rmvb. rmvb ", 15 ). bilinearresize (320,240) Logo = imagesource ("logo2.jpg") logomask = imagesource ("mask2.jpg") overlay (video, logo, mask = logomask)
After converting mencoder to FLV and adding a subtitle watermark, you can add it, but some parameters are not set properly. for example, the Chinese subtitle is only displayed as "_____", and the settings of the file are CD mencoder .. /file/test. mov-o .. /FLV/zbzbzb. FLV-of lavf-OAC mp3lame-lameopts ABR: Br = 56-OVC lavc-lavcopts vcodec = FLV: vbitrate = 500: mbd = 2: mv0: v4mv: last_pred = 3-subpos 5-subfont-text-scale 10-Unicode-font c: \ Arial. TTF-sub .. /file/test. srt-lavfopts I _certify_that_my_video_stream_does_not_use_ B _frames-srate 22050
Pause
The above is executed in a batch file, so it is written as this
Subpos indicates the position of the subtitle. The bigger the vertical direction is, the closer it is to the lower, the lower the vertical direction is. The parameter in the horizontal direction is not found. The minimum value is 0, up to 100 subfont-text-scale: Set the font size-UNICODE character encoding method. Others have not tried-Font font file-sub your subtitle file

Http://ffdshow.faireal.net/mirror/ffmpeg/ of ffmpeg.exe after video Conversion. mencoder http://www5.mplayerhq.hu/MPlayer/releases/win32/ ------------ FFMPEG command use detailed description transferred from: xxlinux.com to darkdoor.0000001-1002.16.jpg sequence frame and 001.mp3 audio files using MPEG4 encoding method to synthesize video files darkdoor. avi: $ FFMPEG-I 001.mp3-I darkdoor.w.3d.jpg-s 1024 × 768-author skypp-vcodec MPEG4 darkdoor. avi
FFmpeg also supports mov format: $ FFMPEG-I darkdoor.20.3d.jpg darkdoor. mov
To view the formats supported by FFMPEG, run the following command: $ FFMPEG-formats | less
You can also export the video file to JPG sequence frame: $ FFMPEG-I bc-cinematic-en.avi example.20.d.jpg
Installing FFMPEG in Debian is simple: # apt-Get install 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. Option A) General option-l license-H help-fromats displays available formats, codec, and protocols... -F fmt forces the format FMT-I filename input file-y to overwrite the output file-T duration to set the recording time hh: mm: ss [. the recording time in XXX] format also supports-SS position to search for the specified time [-] hh: mm: ss [. the format of XXX] also supports-title string setting title-author string setting author-Copyright string setting copyright-Comment string setting comment-target type setting target file type (VCD, SVCD, and DVD) all format options (bit rate, codec, and buffer size) are automatically set. You only need to enter the following: FFMPEG-I myfile. avi-target VCD/tmp/VCD. MPG-HQ activates high-quality settings-itsoffset offset sets 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 [. the format of XXX] also supports B) video option-B bitrate setting bit rate, default kb/s-r FPS setting Frame Rate default 25-s size setting frame size format WXH default 160x128. the following shorthand can also be used directly: sqcif 128x96 qcif 176x144 CIF 252x288 4cif 704x576-aspect setting horizontal/longitudinal ratio or 1.3333 1.7777-croptop size setting Top Removal belt size pixel unit-cropbottom size -cropleft size-cropright size-padtop size: Set the padding size on the top. pixel unit-padbottom size-padleft size-padright size-padcolor color: Set the padding color (Hex, six 16 Numbers in hexadecimal format. Values in red and green are arranged in 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 control buffer size- vcodec codec enforces codec encoding and decoding. If copy is used, the original codec data must be copied. -Sameq uses the same video quality as the source (VBR)-pass n to select the number of processing times (1 or 2 ). Two-time encoding is very useful. Generate statistical information for the first time, and generate precise request bit rate for the second time.-select "file" as the record file twice in passlogfile.
C) advanced video options-G gop_size set image group size-intra only applies to intra-frame encoding-qscale Q uses fixed video quantization scales (VBR) -qmin Q minimum video Quantization Scale (VBR)-Qmax Q maximum video Quantization Scale (VBR)-maximum deviation between qdiff Q quantization scales (VBR) -qblur blur video Quantization Scale softening (VBR)-qcomp compression video Quantization Scale compression (VBR) -Initial complexity of rc_init_cplx complexity encoding-QP factor between P and B-I _qfactor the QP factor between P and I-frames-B _qoffset offset between P and B QP deviation between frames-QP deviation between P and I frames-rc_eq equation sets the default bitrate control equation Tex ^ qcomp-rc_override override for specific interval-me method: The available methods for setting motion estimation are zero phods log X1 EPZs (default) full-dct_algo algo sets the DCT Algorithm There are available 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 to set the IDCT algorithm. Available 0 ff_idct_auto default IDCT 1 ff_idct_int 2 ff_idct_simple 3 limit 4 limit 5 ff_idct_ps2 6 limit 7 ff_idct_arm 8 limit 9 limit 10 limit-er N set error residue to N 1 limit default 2 ff_er_compliant 3 ff_er_aggressive 4 ff_er_very_aggressive-EC bit_mask set error masking to bit_mask, bitmask 1 ff_ec_guess_mvs (default = enabled) 2 ff_ec_deblock (default = Enabled )-BF frames uses frames B frames and supports mpeg1, MPEG2, MPEG4-mbd mode macro block decision 0 ff_mb_decision_simple use mb_cmp 1 limit 2 ff_mb_decision_rd-4mv use 4 motion vectors only for MPEG4-part Use Data Division only for MPEG4-bug Param bypass not automatically problems Detected by encoder-strict strictness and standard rigor-AIC enable advanced in-frame encoding h263 +-umv enable infinite Motion Vector h263 +-deinterlace without interlace-interlace forcing 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-the SNR of the compressed frame is calculated-The vstats output video encoding statistics to the vstats_hhmmss.log-vhook module inserted into the video processing module contains the module name and parameters, separate them with spaces. d) audio option-AB bitrate set audio bit rate-ar freq set audio sampling rate-AC channels set channel default value: 1-An cannot enable audio recording-acodec codec uses codec E) audio/Video Capture option-VD device sets the video capture device. For example, set the/dev/video0-VC channel to set the video capture channel dv1394 dedicated-tvstd standard to set the TV standard NTSC pal (SECAM) -dv1394 set dv1394 capture-AV device set audio devices such as/dev/DSP
F) advanced options-map file: stream sets the input stream ing-Debug prints specific debugging information-benchmark is the benchmark test addition time-hex dumping each input package-bitexact uses only bit precision algorithms for Codec testing-PS size sets the package size, in bits, the-Re reads data at the local frame rate and is mainly used to simulate the capture of the input stream of the device-loop. Only work on image streams, used for ffserver test -------------- conversion video to FLV file process record from: http://xufung.cnblogs.com/video conversion method found a lot, the final process record is as follows: Conversion Environment: window2003 Conversion Tool: FFMPEG conversion steps: 1/download the latest version of ffmpeg.exe from the http://ffdshow.faireal.net/mirror/ffmpeg/ (only known .7z is also a compression format) 2/decompress to local c: \ FFMPEG. 3. Convert the video file command line format: Convert the video: ffmpeg.exe-I "E: \ input \ 06. ASF "" E: \ output \ 06. MPG "// non-FLV format ffmpeg.exe-I" E: \ input \ 06. ASF "-y-AB 56-ar 22050-B 500-R 15-s 320*240 test. FLV // capture the video in FLV format: ffmpeg.exe-I "E: \ input \ 06. ASF "-y-F image2-T 0.001-S 300*200" E: \ output \ 02.jpg "// obtain the static figure ffmpeg.exe-I" E: \ input \ 06. ASF "-vframes 30-y-f gif" E: \ output \ 02.gif "// obtain the dynamic graph 4/convert it to a FLV file, and use the flash client browser tool: 4.1/create a FLA file, and drag flvplayback to the canvas in the window> build. the ALT + F7 skin parameter selects the player appearance. 4.2/select flvplayback, and change the Instance name to ffplay in the property-> parameter. layer key frame writing Code : Ffplay. contentpath = filepath; 5/added to the creation of embedded web pages: <Param name = "flashvars" value = "filepath = FLV file path"> and embed: flashvars = "filepath = FLV file path ". the former is for IE and the latter is for ff. PS. 1. For files that cannot be parsed by FFMPEG (wmv9, RM, rmvb), you can use other tools (mencoder) to convert to Avi or MPG format. 2. If the client tool does not have a timeline after being converted to FLV, use flvmdi.exe to add the time header to the FLV file. The command is flvmdi.exe "filename. FLV "/K -------------- use mencoder to convert any video format to FLV http://www.jcwcn.com/html/geshizh/14_12_25_632.html

Here are some useful examples of some parameters: ffmpeg.exe-I f: \ .mp3-AB 56-ar 22050-B 500-R 15-s 320x240 F: \ 11.flv FFMPEG-I f: \ 01.wmv-AB 56-ar 22050-B 500-R 15-s 320x240 F: \ test. FLV uses the-SS parameter (time_off set the Start Time Offset) to start the conversion task from a specified time point. For example, capture the thumbnail while converting the file format: FFMPEG-I "test. avi "-y-F image2-SS 8-T 0.001-s 350x240 'test.jpg 'capture an existing FLV: FFMPEG-I" test. FLV "-y-F image2-SS 8-T 0.001-s 350x240 'test.jpg '-SS is followed by the second FFMPEG conversion command FFMPEG-y-I test. MPEG-bitexact-vcodec h263-B 128-R 15-s 176x144-acodec AAC-AC 2-ar 22500-AB 24-F 3GP test.3gp or FFMPEG-y-I test. MPEG-Ac 1-acodec amr_nb-ar 8000-s 176x144-B 128-R 15 test.3gp FFMPEG parameter setting explanation-bitexact uses standard bit rate-vcodec Xvid uses Xvid to compress-s 320x240 specifies the resolution-r 29.97 percentile rate (which can be changed, make sure that the non-standard watermark rate will cause audio and video to be not synchronized, so it can only be set to 15 or 29.97). Choose-B <bit rate> to specify the compression bit rate. It seems that FFmpeg is automatically VBR, if this parameter is specified, it is probably the average bit rate. For example, 0.01 or 255 is the default-qscale <value> quality-based VBR in the original project. The value ranges from, the smaller the quality, the better.-qmin <value> sets the minimum quality, which is shared with-Qmax (set the maximum quality, for example,-qmin 10-Qmax 31-sameq uses the same quality sound as the source part-acodec AAC sets the sound encoding-AC <value> sets the number of audio channels, 1 is the single channel, 2 is the stereo, the tvrip for single channel conversion can use 1 (saving half of the capacity), and the High Quality DVDRip can use 2-ar <sampling rate> to set the sound sampling rate, PSP only recognizes 24000-AB <bit rate> to set the sound bit rate. When the front-ac is set to stereo, it must be set to half the bit rate. For example, if it is set to 96 at kbps, the default bitrate of conversion is relatively small. If you want to hear high-quality sound, we recommend that you set it to 160 kbps (80) or above-Vol <percentage> to set the volume. The AC3 track volume of some DVDRip is extremely small, this can be used to increase the volume during conversion. For example, 200 is twice the original volume. To obtain an MP4 with high quality and low capacity, we recommend that you do not use a fixed bit rate for the image, but use the VBR parameter to increase the volume.Program You can judge by yourself, and the sound quality parameter can be improved a little on the basis of the original, it sounds much more comfortable, and it will not be too large (see the case below for an 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-muxvisual 768 "1. ***"
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 ). Parameter:-y (overwrite the output file, that is, if 1. * ** if the file already exists, it will be overwritten without prompt.)-I "1.avi" (the input file is 1 in the same directory as FFMPEG. AVI file, you can add the path and change the name)-title "test" (the title of the video displayed in PSP)-vcodec Xvid (videos compressed using Xvid encoding cannot be changed) -s 368x208 (the output resolution is 368x208. Note that the video source must be 16: 9 or it will be deformed)-R 29.97 (this is usually used for the number of frames) -B 1500 (for video data traffic, use the-B XXXX command to use a fixed bit rate. The number can be changed as needed, and the value above 1500 does not work. Dynamic bit rates can also be used, for example: -qscale 4 and-qscale 6, 4 mass ratio 6)-acodec aac (AAC for Audio Encoding)-AC 2 (number of Audio Channels 1 or 2)-AR 24000 (sound sampling frequency, it seems that PSP only supports 24000Hz)-AB 128 (audio data traffic, usually 32, 64, 96, 128)-Vol 200 (200% volume, change it by yourself) -f psp (exclusive output PSP format)-muxvb 768 (it seems to be the bit rate recognized by PSP machines. Generally, 384, 512, and 768 are selected. I changed it to 1500, PSP says the file is corrupted.) "1. * ** "(output file name, you can also add a path to change the file name)
P.s. If the moderator machine is strong, you can open several more batch files for parallel processing. E: \ ffmpeg.exe-I: \ 1.wmv-B 360-R 25-s 320x240-HQ-deinterlace-AB 56-ar 22050-Ac 1 D: \ 2.flv
Both FFMPEG and mencoder are open-source projects and can be used perfectly on Linux, Mac, Win32, and other platforms. however, mencoder does not support thumbnails. you use FFMPEG to simulate the Linux environment using mingw. mencoder is relatively simple because there are more documents than FFMPEG. it is part of mplayer.

 

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.