FFMPEG command line options and Complete Explanations

Mar 9th, 2011
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. If in any case this list is deprecated or become invalid,
  2. go to: http://www.ffmpeg.org/ffmpeg-doc.html,
  3. search for :
  4. - Main options
  5. - Video options
  6. - Advanced Video options
  7. - Audio options
  8. - Advanced Audio options
  9. - Audio/Video grab options
  10. - Advanced options
  11. - Or any other options that's not available at the time of writing
  13. and modify this pastebin entry, then notify me of such notifications if you may :)
  16. Main options:
  17. -L show license
  18. -h show help
  19. -version show version
  20. -formats show available formats, codecs, protocols, ...
  21. -f fmt force format
  22. -img img_fmt force image format
  23. -i filename input file name
  24. -y overwrite output files
  25. -t duration set the recording time
  26. -fs limit_size set the limit file size
  27. -ss time_off set the start time offset
  28. -itsoffset time_off set the input ts offset
  29. -title string set the title
  30. -timestamp time set the timestamp
  31. -author string set the author
  32. -copyright string set the copyright
  33. -comment string set the comment
  34. -v verbose control amount of logging
  35. -target type specify target file type ("vcd", "svcd", "dvd", "dv", "pal-vcd", "ntsc-svcd", ...)
  36. -dframes number set the number of data frames to record
  37. -hq activate high quality settings
  38. -scodec codec force subtitle codec ('copy' to copy stream)
  39. -newsubtitle add a new subtitle stream to the current output stream
  40. -slang code set the ISO 639 language code (3 letters) of the current subtitle stream
  42. Video options:
  43. -b bitrate set video bitrate (in kbit/s)
  44. -vframes number set the number of video frames to record
  45. -r rate set frame rate (Hz value, fraction or abbreviation)
  46. -s size set frame size (WxH or abbreviation)
  47. -aspect aspect set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
  48. -fixaspect fix aspect ratio
  49. -croptop size set top crop band size (in pixels)
  50. -cropbottom size set bottom crop band size (in pixels)
  51. -cropleft size set left crop band size (in pixels)
  52. -cropright size set right crop band size (in pixels)
  53. -padtop size set top pad band size (in pixels)
  54. -padbottom size set bottom pad band size (in pixels)
  55. -padleft size set left pad band size (in pixels)
  56. -padright size set right pad band size (in pixels)
  57. -padcolor color set color of pad bands (Hex 000000 thru FFFFFF)
  58. -vn disable video
  59. -bt tolerance set video bitrate tolerance (in kbit/s)
  60. -maxrate bitrate set max video bitrate tolerance (in kbit/s)
  61. -minrate bitrate set min video bitrate tolerance (in kbit/s)
  62. -bufsize size set ratecontrol buffer size (in kByte)
  63. -vcodec codec force video codec ('copy' to copy stream)
  64. -sameq use same video quality as source (implies VBR)
  65. -pass n select the pass number (1 or 2)
  66. -passlogfile file select two pass log file name
  67. -newvideo add a new video stream to the current output stream
  69. Advanced Video options:
  70. -pix_fmt format set pixel format
  71. -g gop_size set the group of picture size
  72. -intra use only intra frames
  73. -vdt n discard threshold
  74. -qscale q use fixed video quantiser scale (VBR)
  75. -qmin q min video quantiser scale (VBR)
  76. -qmax q max video quantiser scale (VBR)
  77. -lmin lambda min video lagrange factor (VBR)
  78. -lmax lambda max video lagrange factor (VBR)
  79. -mblmin q min macroblock quantiser scale (VBR)
  80. -mblmax q max macroblock quantiser scale (VBR)
  81. -qdiff q max difference between the quantiser scale (VBR)
  82. -qblur blur video quantiser scale blur (VBR)
  83. -qsquish squish how to keep quantiser between qmin and qmax (0 = clip, 1 = use differentiable function)
  84. -qcomp compression video quantiser scale compression (VBR)
  85. -rc_init_cplx complexity initial complexity for 1-pass encoding
  86. -b_qfactor factor qp factor between p and b frames
  87. -i_qfactor factor qp factor between p and i frames
  88. -b_qoffset offset qp offset between p and b frames
  89. -i_qoffset offset qp offset between p and i frames
  90. -ibias bias intra quant bias
  91. -pbias bias inter quant bias
  92. -rc_eq equation set rate control equation
  93. -rc_override override rate control override for specific intervals
  94. -me method set motion estimation method
  95. -dct_algo algo set dct algo
  96. -idct_algo algo set idct algo
  97. -me_threshold motion estimaton threshold
  98. -mb_threshold macroblock threshold
  99. -er n set error resilience
  100. -ec bit_mask set error concealment
  101. -bf frames use 'frames' B frames
  102. -mbd mode macroblock decision
  103. -mbcmp cmp function macroblock compare function
  104. -ildctcmp cmp function ildct compare function
  105. -subcmp cmp function subpel compare function
  106. -cmp cmp function fullpel compare function
  107. -precmp cmp function pre motion estimation compare function
  108. -preme pre motion estimation
  109. -lelim elim single coefficient elimination threshold for luminance (negative values also consider DC coefficient)
  110. -celim elim single coefficient elimination threshold for chrominance (negative values also consider DC coefficient)
  111. -lumi_mask luminance masking
  112. -dark_mask darkness masking
  113. -scplx_mask spatial complexity masking
  114. -tcplx_mask temporal complexity masking
  115. -p_mask inter masking
  116. -4mv use four motion vector by macroblock (MPEG4)
  117. -obmc use overlapped block motion compensation (h263+)
  118. -lf use loop filter (h263+)
  119. -part use data partitioning (MPEG4)
  120. -bug param workaround not auto detected encoder bugs
  121. -strict strictness how strictly to follow the standards
  122. -deinterlace deinterlace pictures
  123. -ildct force interlaced dct support in encoder (MPEG2/MPEG4)
  124. -ilme force interlaced me support in encoder (MPEG2/MPEG4)
  125. -psnr calculate PSNR of compressed frames
  126. -vstats dump video coding statistics to file
  127. -vhook module insert video processing module
  128. -aic enable Advanced intra coding (h263+)
  129. -aiv enable Alternative inter vlc (h263+)
  130. -umv enable Unlimited Motion Vector (h263+)
  131. -ssm enable Slice Structured mode (h263+)
  132. -alt enable alternate scantable (MPEG2/MPEG4)
  133. -qprd
  134. -cbp
  135. -trell enable trellis quantization
  136. -mv0 try to encode each MB with MV=<0,0> and choose the better one (has no effect if mbd=0)
  137. -naq normalize adaptive quantization
  138. -cgop closed gop
  139. -sgop strict gop
  140. -noout skip bitstream encoding
  141. -scan_offset enable SVCD Scan Offset placeholder
  142. -qpel enable 1/4-pel
  143. -intra_matrix matrix specify intra matrix coeffs
  144. -inter_matrix matrix specify inter matrix coeffs
  145. -top top=1/bottom=0/auto=-1 field first
  146. -nr noise reduction
  147. -qns quantization noise shaping
  148. -sc_threshold threshold scene change threshold
  149. -me_range range limit motion vectors range (1023 for DivX player)
  150. -dc precision intra_dc_precision
  151. -coder coder type
  152. -context context model
  153. -pred prediction method
  154. -vprofile profile
  155. -vlevel level
  156. -nssew weight
  157. -subq
  158. -mepc factor (1.0 = 256) motion estimation bitrate penalty compensation
  159. -lowres
  160. -vtag fourcc/tag force video tag/fourcc
  161. -skip_threshold threshold frame skip threshold
  162. -skip_factor factor frame skip factor
  163. -skip_exp exponent frame skip exponent
  164. -skip_cmp compare function frame skip compare function
  165. -gray encode/decode grayscale
  167. Audio options:
  168. -aframes number set the number of audio frames to record
  169. -ab bitrate set audio bitrate (in kbit/s)
  170. -ar rate set audio sampling rate (in Hz)
  171. -ac channels set number of audio channels
  172. -an disable audio
  173. -acodec codec force audio codec ('copy' to copy stream)
  174. -vol volume change audio volume (256=normal)
  175. -newaudio add a new audio stream to the current output stream
  176. -alang code set the ISO 639 language code (3 letters) of the current audio stream
  178. Advanced Audio options:
  179. -atag fourcc/tag force audio tag/fourcc
  181. Subtitle options:
  182. -scodec codec force subtitle codec ('copy' to copy stream)
  183. -newsubtitle add a new subtitle stream to the current output stream
  184. -slang code set the ISO 639 language code (3 letters) of the current subtitle stream
  186. Audio/Video grab options:
  187. -vd device set video grab device
  188. -vc channel set video grab channel (DV1394 only)
  189. -tvstd standard set television standard (NTSC, PAL (SECAM))
  190. -ad device set audio device
  191. -grab format request grabbing using
  192. -gd device set grab device
  194. Advanced options:
  195. -map file:stream[:syncfile:syncstream] set input stream mapping
  196. -map_meta_data outfile:infile set meta data information of outfile from infile
  197. -debug print specific debug info
  198. -vismv visualize motion vectors
  199. -benchmark add timings for benchmarking
  200. -dump dump each input packet
  201. -hex when dumping packets, also dump the payload
  202. -bitexact only use bit exact algorithms (for codec testing)
  203. -re read input at native frame rate
  204. -loop loop (current only works with images)
  205. -loop_output number of times to loop output in formats that support looping (0 loops forever)
  206. -threads count thread count
  207. -vsync video sync method
  208. -async audio sync method
  209. -vglobal video global header storage type
  210. -copyts copy timestamps
  211. -shortest finish encoding within shortest input
  212. -b_strategy strategy dynamic b frame selection strategy
  213. -ps size set packet size in bits
  214. -error rate error rate
  215. -muxrate rate set mux rate
  216. -packetsize size set packet size
  217. -muxdelay seconds set the maximum demux-decode delay
  218. -muxpreload seconds set the initial demux-decode delay
  219. -muxab bitrate set the audio bitrate in mux tag (in kbit/s)
  220. -muxvb bitrate set the video bitrate in mux tag (in kbit/s)
  222. Complete Explanations as copied from: http://www.ffmpeg.org/ffmpeg-doc.html
  224. 3. Options
  226. All the numerical options, if not specified otherwise, accept in input a string representing a number, which may contain one of the International System number postfixes, for example 'K', 'M', 'G'. If 'i' is appended after the postfix, powers of 2 are used instead of powers of 10. The 'B' postfix multiplies the value for 8, and can be appended after another postfix or used alone. This allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
  228. Options which do not take arguments are boolean options, and set the corresponding value to true. They can be set to false by prefixing with "no" the option name, for example using "-nofoo" in the commandline will set to false the boolean option with name "foo".
  230. 3.1 Generic options
  232. These options are shared amongst the ff* tools.
  234. `-L'
  235. Show license.
  236. `-h, -?, -help, --help'
  237. Show help.
  238. `-version'
  239. Show version.
  240. `-formats'
  241. Show available formats. The fields preceding the format names have the following meanings:
  242. `D'
  243. Decoding available
  244. `E'
  245. Encoding available
  246. `-codecs'
  247. Show available codecs. The fields preceding the codec names have the following meanings:
  248. `D'
  249. Decoding available
  250. `E'
  251. Encoding available
  252. `V/A/S'
  253. Video/audio/subtitle codec
  254. `S'
  255. Codec supports slices
  256. `D'
  257. Codec supports direct rendering
  258. `T'
  259. Codec can handle input truncated at random locations instead of only at frame boundaries
  260. `-bsfs'
  261. Show available bitstream filters.
  262. `-protocols'
  263. Show available protocols.
  264. `-filters'
  265. Show available libavfilter filters.
  266. `-pix_fmts'
  267. Show available pixel formats.
  268. `-loglevel loglevel'
  269. Set the logging level used by the library. loglevel is a number or a string containing one of the following values:
  270. `quiet'
  271. `panic'
  272. `fatal'
  273. `error'
  274. `warning'
  275. `info'
  276. `verbose'
  277. `debug'
  278. By default the program logs to stderr, if coloring is supported by the terminal, colors are used to mark errors and warnings. Log coloring can be disabled setting the environment variable @env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting the environment variable @env{FFMPEG_FORCE_COLOR}. The use of the environment variable @env{NO_COLOR} is deprecated and will be dropped in a following FFmpeg version.
  279. 3.2 Main options
  281. `-f fmt'
  282. Force format.
  283. `-i filename'
  284. input file name
  285. `-y'
  286. Overwrite output files.
  287. `-t duration'
  288. Restrict the transcoded/captured video sequence to the duration specified in seconds. hh:mm:ss[.xxx] syntax is also supported.
  289. `-fs limit_size'
  290. Set the file size limit.
  291. `-ss position'
  292. Seek to given time position in seconds. hh:mm:ss[.xxx] syntax is also supported.
  293. `-itsoffset offset'
  294. Set the input time offset in seconds. [-]hh:mm:ss[.xxx] syntax is also supported. This option affects all the input files that follow it. The offset is added to the timestamps of the input files. Specifying a positive offset means that the corresponding streams are delayed by 'offset' seconds.
  295. `-timestamp time'
  296. Set the recording timestamp in the container. The syntax for time is:
  297. now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z])
  298. If the value is "now" it takes the current time. Time is local time unless 'Z' or 'z' is appended, in which case it is interpreted as UTC. If the year-month-day part is not specified it takes the current year-month-day.
  299. `-metadata key=value'
  300. Set a metadata key/value pair. For example, for setting the title in the output file:
  301. ffmpeg -i in.avi -metadata title="my title" out.flv
  302. `-v number'
  303. Set the logging verbosity level.
  304. `-target type'
  305. Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ... ). All the format options (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  306. ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  307. Nevertheless you can specify additional options as long as you know they do not conflict with the standard, as in:
  308. ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  309. `-dframes number'
  310. Set the number of data frames to record.
  311. `-scodec codec'
  312. Force subtitle codec ('copy' to copy stream).
  313. `-newsubtitle'
  314. Add a new subtitle stream to the current output stream.
  315. `-slang code'
  316. Set the ISO 639 language code (3 letters) of the current subtitle stream.
  317. 3.3 Video Options
  319. `-b bitrate'
  320. Set the video bitrate in bit/s (default = 200 kb/s).
  321. `-vframes number'
  322. Set the number of video frames to record.
  323. `-r fps'
  324. Set frame rate (Hz value, fraction or abbreviation), (default = 25).
  325. `-s size'
  326. Set frame size. The format is `wxh' (ffserver default = 160x128, ffmpeg default = same as source). The following abbreviations are recognized:
  327. `sqcif'
  328. 128x96
  329. `qcif'
  330. 176x144
  331. `cif'
  332. 352x288
  333. `4cif'
  334. 704x576
  335. `16cif'
  336. 1408x1152
  337. `qqvga'
  338. 160x120
  339. `qvga'
  340. 320x240
  341. `vga'
  342. 640x480
  343. `svga'
  344. 800x600
  345. `xga'
  346. 1024x768
  347. `uxga'
  348. 1600x1200
  349. `qxga'
  350. 2048x1536
  351. `sxga'
  352. 1280x1024
  353. `qsxga'
  354. 2560x2048
  355. `hsxga'
  356. 5120x4096
  357. `wvga'
  358. 852x480
  359. `wxga'
  360. 1366x768
  361. `wsxga'
  362. 1600x1024
  363. `wuxga'
  364. 1920x1200
  365. `woxga'
  366. 2560x1600
  367. `wqsxga'
  368. 3200x2048
  369. `wquxga'
  370. 3840x2400
  371. `whsxga'
  372. 6400x4096
  373. `whuxga'
  374. 7680x4800
  375. `cga'
  376. 320x200
  377. `ega'
  378. 640x350
  379. `hd480'
  380. 852x480
  381. `hd720'
  382. 1280x720
  383. `hd1080'
  384. 1920x1080
  385. `-aspect aspect'
  386. Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777).
  387. `-croptop size'
  388. `-cropbottom size'
  389. `-cropleft size'
  390. `-cropright size'
  391. All the crop options have been removed. Use -vf crop=width:height:x:y instead.
  392. `-padtop size'
  393. `-padbottom size'
  394. `-padleft size'
  395. `-padright size'
  396. `-padcolor hex_color'
  397. All the pad options have been removed. Use -vf pad=width:height:x:y:color instead.
  398. `-vn'
  399. Disable video recording.
  400. `-bt tolerance'
  401. Set video bitrate tolerance (in bits, default 4000k). Has a minimum value of: (target_bitrate/target_framerate). In 1-pass mode, bitrate tolerance specifies how far ratecontrol is willing to deviate from the target average bitrate value. This is not related to min/max bitrate. Lowering tolerance too much has an adverse effect on quality.
  402. `-maxrate bitrate'
  403. Set max video bitrate (in bit/s). Requires -bufsize to be set.
  404. `-minrate bitrate'
  405. Set min video bitrate (in bit/s). Most useful in setting up a CBR encode:
  406. ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  407. It is of little use elsewise.
  408. `-bufsize size'
  409. Set video buffer verifier buffer size (in bits).
  410. `-vcodec codec'
  411. Force video codec to codec. Use the copy special value to tell that the raw codec data must be copied as is.
  412. `-sameq'
  413. Use same video quality as source (implies VBR).
  414. `-pass n'
  415. Select the pass number (1 or 2). It is used to do two-pass video encoding. The statistics of the video are recorded in the first pass into a log file (see also the option -passlogfile), and in the second pass that log file is used to generate the video at the exact requested bitrate. On pass 1, you may just deactivate audio and set output to null, examples for Windows and Unix:
  416. ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
  417. ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
  418. `-passlogfile prefix'
  419. Set two-pass log file name prefix to prefix, the default file name prefix is "ffmpeg2pass". The complete file name will be `PREFIX-N.log', where N is a number specific to the output stream.
  420. `-newvideo'
  421. Add a new video stream to the current output stream.
  422. `-vlang code'
  423. Set the ISO 639 language code (3 letters) of the current video stream.
  424. `-vf filter_graph'
  425. filter_graph is a description of the filter graph to apply to the input video. Use the option "-filters" to show all the available filters (including also sources and sinks).
  426. 3.4 Advanced Video Options
  428. `-pix_fmt format'
  429. Set pixel format. Use 'list' as parameter to show all the supported pixel formats.
  430. `-sws_flags flags'
  431. Set SwScaler flags.
  432. `-g gop_size'
  433. Set the group of pictures size.
  434. `-intra'
  435. Use only intra frames.
  436. `-vdt n'
  437. Discard threshold.
  438. `-qscale q'
  439. Use fixed video quantizer scale (VBR).
  440. `-qmin q'
  441. minimum video quantizer scale (VBR)
  442. `-qmax q'
  443. maximum video quantizer scale (VBR)
  444. `-qdiff q'
  445. maximum difference between the quantizer scales (VBR)
  446. `-qblur blur'
  447. video quantizer scale blur (VBR) (range 0.0 - 1.0)
  448. `-qcomp compression'
  449. video quantizer scale compression (VBR) (default 0.5). Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
  450. `-lmin lambda'
  451. minimum video lagrange factor (VBR)
  452. `-lmax lambda'
  453. max video lagrange factor (VBR)
  454. `-mblmin lambda'
  455. minimum macroblock quantizer scale (VBR)
  456. `-mblmax lambda'
  457. maximum macroblock quantizer scale (VBR) These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units, but you may use the QP2LAMBDA constant to easily convert from 'q' units:
  458. ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  459. `-rc_init_cplx complexity'
  460. initial complexity for single pass encoding
  461. `-b_qfactor factor'
  462. qp factor between P- and B-frames
  463. `-i_qfactor factor'
  464. qp factor between P- and I-frames
  465. `-b_qoffset offset'
  466. qp offset between P- and B-frames
  467. `-i_qoffset offset'
  468. qp offset between P- and I-frames
  469. `-rc_eq equation'
  470. Set rate control equation (see section "Expression Evaluation") (default = tex^qComp). When computing the rate control equation expression, besides the standard functions defined in the section "Expression Evaluation", the following functions are available:
  471. bits2qp(bits)
  472. qp2bits(qp)
  473. and the following constants are available:
  474. iTex
  475. pTex
  476. tex
  477. mv
  478. fCode
  479. iCount
  480. mcVar
  481. var
  482. isI
  483. isP
  484. isB
  485. avgQP
  486. qComp
  487. avgIITex
  488. avgPITex
  489. avgPPTex
  490. avgBPTex
  491. avgTex
  492. `-rc_override override'
  493. rate control override for specific intervals
  494. `-me_method method'
  495. Set motion estimation method to method. Available methods are (from lowest to best quality):
  496. `zero'
  497. Try just the (0, 0) vector.
  498. `phods'
  499. `log'
  500. `x1'
  501. `hex'
  502. `umh'
  503. `epzs'
  504. (default method)
  505. `full'
  506. exhaustive search (slow and marginally better than epzs)
  507. `-dct_algo algo'
  508. Set DCT algorithm to algo. Available values are:
  509. `0'
  510. FF_DCT_AUTO (default)
  511. `1'
  513. `2'
  514. FF_DCT_INT
  515. `3'
  516. FF_DCT_MMX
  517. `4'
  518. FF_DCT_MLIB
  519. `5'
  521. `-idct_algo algo'
  522. Set IDCT algorithm to algo. Available values are:
  523. `0'
  524. FF_IDCT_AUTO (default)
  525. `1'
  526. FF_IDCT_INT
  527. `2'
  529. `3'
  531. `4'
  533. `5'
  534. FF_IDCT_PS2
  535. `6'
  537. `7'
  538. FF_IDCT_ARM
  539. `8'
  541. `9'
  542. FF_IDCT_SH4
  543. `10'
  545. `-er n'
  546. Set error resilience to n.
  547. `1'
  548. FF_ER_CAREFUL (default)
  549. `2'
  551. `3'
  553. `4'
  555. `-ec bit_mask'
  556. Set error concealment to bit_mask. bit_mask is a bit mask of the following values:
  557. `1'
  558. FF_EC_GUESS_MVS (default = enabled)
  559. `2'
  560. FF_EC_DEBLOCK (default = enabled)
  561. `-bf frames'
  562. Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
  563. `-mbd mode'
  564. macroblock decision
  565. `0'
  566. FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in FFmpeg).
  567. `1'
  568. FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
  569. `2'
  570. FF_MB_DECISION_RD: rate distortion
  571. `-4mv'
  572. Use four motion vector by macroblock (MPEG-4 only).
  573. `-part'
  574. Use data partitioning (MPEG-4 only).
  575. `-bug param'
  576. Work around encoder bugs that are not auto-detected.
  577. `-strict strictness'
  578. How strictly to follow the standards.
  579. `-aic'
  580. Enable Advanced intra coding (h263+).
  581. `-umv'
  582. Enable Unlimited Motion Vector (h263+)
  583. `-deinterlace'
  584. Deinterlace pictures.
  585. `-ilme'
  586. Force interlacing support in encoder (MPEG-2 and MPEG-4 only). Use this option if your input file is interlaced and you want to keep the interlaced format for minimum losses. The alternative is to deinterlace the input stream with `-deinterlace', but deinterlacing introduces losses.
  587. `-psnr'
  588. Calculate PSNR of compressed frames.
  589. `-vstats'
  590. Dump video coding statistics to `vstats_HHMMSS.log'.
  591. `-vstats_file file'
  592. Dump video coding statistics to file.
  593. `-top n'
  594. top=1/bottom=0/auto=-1 field first
  595. `-dc precision'
  596. Intra_dc_precision.
  597. `-vtag fourcc/tag'
  598. Force video tag/fourcc.
  599. `-qphist'
  600. Show QP histogram.
  601. `-vbsf bitstream_filter'
  602. Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg".
  603. ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
  604. `-force_key_frames time[,time...]'
  605. Force key frames at the specified timestamps, more precisely at the first frames after each specified time. This option can be useful to ensure that a seek point is present at a chapter mark or any other designated place in the output file. The timestamps must be specified in ascending order.
  606. 3.5 Audio Options
  608. `-aframes number'
  609. Set the number of audio frames to record.
  610. `-ar freq'
  611. Set the audio sampling frequency (default = 44100 Hz).
  612. `-ab bitrate'
  613. Set the audio bitrate in bit/s (default = 64k).
  614. `-aq q'
  615. Set the audio quality (codec-specific, VBR).
  616. `-ac channels'
  617. Set the number of audio channels. For input streams it is set by default to 1, for output streams it is set by default to the same number of audio channels in input. If the input file has audio streams with different channel count, the behaviour is undefined.
  618. `-an'
  619. Disable audio recording.
  620. `-acodec codec'
  621. Force audio codec to codec. Use the copy special value to specify that the raw codec data must be copied as is.
  622. `-newaudio'
  623. Add a new audio track to the output file. If you want to specify parameters, do so before -newaudio (-acodec, -ab, etc..). Mapping will be done automatically, if the number of output streams is equal to the number of input streams, else it will pick the first one that matches. You can override the mapping using -map as usual. Example:
  624. ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
  625. `-alang code'
  626. Set the ISO 639 language code (3 letters) of the current audio stream.
  627. 3.6 Advanced Audio options:
  629. `-atag fourcc/tag'
  630. Force audio tag/fourcc.
  631. `-absf bitstream_filter'
  632. Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
  633. 3.7 Subtitle options:
  635. `-scodec codec'
  636. Force subtitle codec ('copy' to copy stream).
  637. `-newsubtitle'
  638. Add a new subtitle stream to the current output stream.
  639. `-slang code'
  640. Set the ISO 639 language code (3 letters) of the current subtitle stream.
  641. `-sn'
  642. Disable subtitle recording.
  643. `-sbsf bitstream_filter'
  644. Bitstream filters available are "mov2textsub", "text2movsub".
  645. ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
  646. 3.8 Audio/Video grab options
  648. `-vc channel'
  649. Set video grab channel (DV1394 only).
  650. `-tvstd standard'
  651. Set television standard (NTSC, PAL (SECAM)).
  652. `-isync'
  653. Synchronize read on input.
  654. 3.9 Advanced options
  656. `-map input_stream_id[:sync_stream_id]'
  657. Set stream mapping from input streams to output streams. Just enumerate the input streams in the order you want them in the output. sync_stream_id if specified sets the input stream to sync against.
  658. `-map_meta_data outfile[,metadata]:infile[,metadata]'
  659. Set meta data information of outfile from infile. Note that those are file indices (zero-based), not filenames. Optional metadata parameters specify, which metadata to copy - (g)lobal (i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or per-(p)rogram. All metadata specifiers other than global must be followed by the stream/chapter/program number. If metadata specifier is omitted, it defaults to global. By default, global metadata is copied from the first input file to all output files, per-stream and per-chapter metadata is copied along with streams/chapters. These default mappings are disabled by creating any mapping of the relevant type. A negative file index can be used to create a dummy mapping that just disables automatic copying. For example to copy metadata from the first stream of the input file to global metadata of the output file:
  660. ffmpeg -i in.ogg -map_meta_data 0:0,s0 out.mp3
  661. `-map_chapters outfile:infile'
  662. Copy chapters from infile to outfile. If no chapter mapping is specified, then chapters are copied from the first input file with at least one chapter to all output files. Use a negative file index to disable any chapter copying.
  663. `-debug'
  664. Print specific debug info.
  665. `-benchmark'
  666. Show benchmarking information at the end of an encode. Shows CPU time used and maximum memory consumption. Maximum memory consumption is not supported on all systems, it will usually display as 0 if not supported.
  667. `-dump'
  668. Dump each input packet.
  669. `-hex'
  670. When dumping packets, also dump the payload.
  671. `-bitexact'
  672. Only use bit exact algorithms (for codec testing).
  673. `-ps size'
  674. Set RTP payload size in bytes.
  675. `-re'
  676. Read input at native frame rate. Mainly used to simulate a grab device.
  677. `-loop_input'
  678. Loop over the input stream. Currently it works only for image streams. This option is used for automatic FFserver testing.
  679. `-loop_output number_of_times'
  680. Repeatedly loop output for formats that support looping such as animated GIF (0 will loop the output infinitely).
  681. `-threads count'
  682. Thread count.
  683. `-vsync parameter'
  684. Video sync method. 0 Each frame is passed with its timestamp from the demuxer to the muxer 1 Frames will be duplicated and dropped to achieve exactly the requested constant framerate. 2 Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp -1 Chooses between 1 and 2 depending on muxer capabilities. This is the default method. With -map you can select from which stream the timestamps should be taken. You can leave either video or audio unchanged and sync the remaining stream(s) to the unchanged one.
  685. `-async samples_per_second'
  686. Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, the parameter is the maximum samples per second by which the audio is changed. -async 1 is a special case where only the start of the audio stream is corrected without any later correction.
  687. `-copyts'
  688. Copy timestamps from input to output.
  689. `-shortest'
  690. Finish encoding when the shortest input stream ends.
  691. `-dts_delta_threshold'
  692. Timestamp discontinuity delta threshold.
  693. `-muxdelay seconds'
  694. Set the maximum demux-decode delay.
  695. `-muxpreload seconds'
  696. Set the initial demux-decode delay.
  697. `-streamid output-stream-index:new-value'
  698. Assign a new value to a stream's stream-id field in the next output file. All stream-id fields are reset to default for each output file. For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for an output mpegts file:
  699. ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
  700. 3.10 Preset files
  702. A preset file contains a sequence of option=value pairs, one for each line, specifying a sequence of options which would be awkward to specify on the command line. Lines starting with the hash ('#') character are ignored and are used to provide comments. Check the `ffpresets' directory in the FFmpeg source tree for examples.
  704. Preset files are specified with the vpre, apre, spre, and fpre options. The fpre option takes the filename of the preset instead of a preset name as input and can be used for any kind of codec. For the vpre, apre, and spre options, the options specified in a preset file are applied to the currently selected codec of the same type as the preset option.
  706. The argument passed to the vpre, apre, and spre preset options identifies the preset file to use according to the following rules:
  708. First ffmpeg searches for a file named arg.ffpreset in the directories `$FFMPEG_DATADIR' (if set), and `$HOME/.ffmpeg', and in the datadir defined at configuration time (usually `PREFIX/share/ffmpeg') in that order. For example, if the argument is libx264-max, it will search for the file `libx264-max.ffpreset'.
  710. If no such file is found, then ffmpeg will search for a file named codec_name-arg.ffpreset in the above-mentioned directories, where codec_name is the name of the codec to which the preset file options will be applied. For example, if you select the video codec with -vcodec libx264 and use -vpre max, then it will search for the file `libx264-max.ffpreset'.
RAW Paste Data