Advertisement
xiaose

MAN FFmpeg

Oct 14th, 2014
5,539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 151.59 KB | None | 0 0
  1. FFMPEG(1) FFMPEG(1)
  2.  
  3.  
  4.  
  5. NAME
  6. ffmpeg - ffmpeg video converter
  7.  
  8. SYNOPSIS
  9. ffmpeg [[infile options][-i infile]]... {[outfile options] outfile}...
  10.  
  11. DESCRIPTION
  12. ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on
  13. the fly with a high quality polyphase filter.
  14.  
  15. The command line interface is designed to be intuitive, in the sense that ffmpeg tries to figure out all parameters that can possibly be derived automatically. You
  16. usually only have to specify the target bitrate you want.
  17.  
  18. As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command line multiple times.
  19. Each occurrence is then applied to the next input or output file.
  20.  
  21. · To set the video bitrate of the output file to 64kbit/s:
  22.  
  23. ffmpeg -i input.avi -b 64k output.avi
  24.  
  25. · To force the frame rate of the output file to 24 fps:
  26.  
  27. ffmpeg -i input.avi -r 24 output.avi
  28.  
  29. · To force the frame rate of the input file (valid for raw formats only) to 1 fps and the frame rate of the output file to 24 fps:
  30.  
  31. ffmpeg -r 1 -i input.m2v -r 24 output.avi
  32.  
  33. The format option may be needed for raw input files.
  34.  
  35. By default ffmpeg tries to convert as losslessly as possible: It uses the same audio and video parameters for the outputs as the one specified for the inputs.
  36.  
  37. OPTIONS
  38. 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,
  39. 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
  40. appended after another postfix or used alone. This allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
  41.  
  42. 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
  43. example using "-nofoo" in the command line will set to false the boolean option with name "foo".
  44.  
  45. Stream specifiers
  46. Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers are used to precisely specify which stream(s) does a given option belong to.
  47.  
  48. A stream specifier is a string generally appended to the option name and separated from it by a colon. E.g. "-codec:a:1 ac3" option contains "a:1" stream specifer, which
  49. matches the second audio stream. Therefore it would select the ac3 codec for the second audio stream.
  50.  
  51. A stream specifier can match several stream, the option is then applied to all of them. E.g. the stream specifier in "-b:a 128k" matches all audio streams.
  52.  
  53. An empty stream specifier matches all streams, for example "-codec copy" or "-codec: copy" would copy all the streams without reencoding.
  54.  
  55. Possible forms of stream specifiers are:
  56.  
  57. stream_index
  58. Matches the stream with this index. E.g. "-threads:1 4" would set the thread count for the second stream to 4.
  59.  
  60. stream_type[:stream_index]
  61. stream_type is one of: 'v' for video, 'a' for audio, 's' for subtitle, 'd' for data and 't' for attachments. If stream_index is given, then matches stream number
  62. stream_index of this type. Otherwise matches all streams of this type.
  63.  
  64. p:program_id[:stream_index]
  65. If stream_index is given, then matches stream number stream_index in program with id program_id. Otherwise matches all streams in this program.
  66.  
  67. Generic options
  68. These options are shared amongst the av* tools.
  69.  
  70. -L Show license.
  71.  
  72. -h, -?, -help, --help
  73. Show help.
  74.  
  75. -version
  76. Show version.
  77.  
  78. -formats
  79. Show available formats.
  80.  
  81. The fields preceding the format names have the following meanings:
  82.  
  83. D Decoding available
  84.  
  85. E Encoding available
  86.  
  87. -codecs
  88. Show available codecs.
  89.  
  90. The fields preceding the codec names have the following meanings:
  91.  
  92. D Decoding available
  93.  
  94. E Encoding available
  95.  
  96. V/A/S
  97. Video/audio/subtitle codec
  98.  
  99. S Codec supports slices
  100.  
  101. D Codec supports direct rendering
  102.  
  103. T Codec can handle input truncated at random locations instead of only at frame boundaries
  104.  
  105. -bsfs
  106. Show available bitstream filters.
  107.  
  108. -protocols
  109. Show available protocols.
  110.  
  111. -filters
  112. Show available libavfilter filters.
  113.  
  114. -pix_fmts
  115. Show available pixel formats.
  116.  
  117. -sample_fmts
  118. Show available sample formats.
  119.  
  120. -loglevel loglevel | -v loglevel
  121. Set the logging level used by the library. loglevel is a number or a string containing one of the following values:
  122.  
  123. quiet
  124. panic
  125. fatal
  126. error
  127. warning
  128. info
  129. verbose
  130. debug
  131.  
  132. 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
  133. environment variable AV_LOG_FORCE_NOCOLOR or NO_COLOR, or can be forced setting the environment variable AV_LOG_FORCE_COLOR. The use of the environment variable
  134. NO_COLOR is deprecated and will be dropped in a following Libav version.
  135.  
  136. AVOptions
  137. These options are provided directly by the libavformat, libavdevice and libavcodec libraries. To see the list of available AVOptions, use the -help option. They are
  138. separated into two categories:
  139.  
  140. generic
  141. These options can be set for any container, codec or device. Generic options are listed under AVFormatContext options for containers/devices and under AVCodecContext
  142. options for codecs.
  143.  
  144. private
  145. These options are specific to the given container, device or codec. Private options are listed under their corresponding containers/devices/codecs.
  146.  
  147. For example to write an ID3v2.3 header instead of a default ID3v2.4 to an MP3 file, use the id3v2_version private option of the MP3 muxer:
  148.  
  149. avconv -i input.flac -id3v2_version 3 out.mp3
  150.  
  151. All codec AVOptions are obviously per-stream, so the chapter on stream specifiers applies to them
  152.  
  153. Note -nooption syntax cannot be used for boolean AVOptions, use -option 0/-option 1.
  154.  
  155. Note2 old undocumented way of specifying per-stream AVOptions by prepending v/a/s to the options name is now obsolete and will be removed soon.
  156.  
  157. Main options
  158. -f fmt
  159. Force format.
  160.  
  161. -i filename
  162. input file name
  163.  
  164. -y Overwrite output files.
  165.  
  166. -t duration
  167. Restrict the transcoded/captured video sequence to the duration specified in seconds. "hh:mm:ss[.xxx]" syntax is also supported.
  168.  
  169. -fs limit_size
  170. Set the file size limit.
  171.  
  172. -ss position
  173. Seek to given time position in seconds. "hh:mm:ss[.xxx]" syntax is also supported.
  174.  
  175. -itsoffset offset
  176. 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
  177. the timestamps of the input files. Specifying a positive offset means that the corresponding streams are delayed by 'offset' seconds.
  178.  
  179. -timestamp time
  180. Set the recording timestamp in the container. The syntax for time is:
  181.  
  182. now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z])
  183.  
  184. 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
  185. part is not specified it takes the current year-month-day.
  186.  
  187. -metadata key=value
  188. Set a metadata key/value pair.
  189.  
  190. For example, for setting the title in the output file:
  191.  
  192. ffmpeg -i in.avi -metadata title="my title" out.flv
  193.  
  194. -v number
  195. Set the logging verbosity level.
  196.  
  197. -target type
  198. Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ... ). All the format options (bitrate, codecs, buffer sizes) are then set
  199. automatically. You can just type:
  200.  
  201. ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  202.  
  203. Nevertheless you can specify additional options as long as you know they do not conflict with the standard, as in:
  204.  
  205. ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  206.  
  207. -dframes number
  208. Set the number of data frames to record.
  209.  
  210. -scodec codec
  211. Force subtitle codec ('copy' to copy stream).
  212.  
  213. -newsubtitle
  214. Add a new subtitle stream to the current output stream.
  215.  
  216. -slang code
  217. Set the ISO 639 language code (3 letters) of the current subtitle stream.
  218.  
  219. Video Options
  220. -vframes number
  221. Set the number of video frames to record.
  222.  
  223. -r fps
  224. Set frame rate (Hz value, fraction or abbreviation), (default = 25).
  225.  
  226. -s size
  227. Set frame size. The format is wxh (avserver default = 160x128, ffmpeg default = same as source). The following abbreviations are recognized:
  228.  
  229. sqcif
  230. 128x96
  231.  
  232. qcif
  233. 176x144
  234.  
  235. cif 352x288
  236.  
  237. 4cif
  238. 704x576
  239.  
  240. 16cif
  241. 1408x1152
  242.  
  243. qqvga
  244. 160x120
  245.  
  246. qvga
  247. 320x240
  248.  
  249. vga 640x480
  250.  
  251. svga
  252. 800x600
  253.  
  254. xga 1024x768
  255.  
  256. uxga
  257. 1600x1200
  258.  
  259. qxga
  260. 2048x1536
  261.  
  262. sxga
  263. 1280x1024
  264.  
  265. qsxga
  266. 2560x2048
  267.  
  268. hsxga
  269. 5120x4096
  270.  
  271. wvga
  272. 852x480
  273.  
  274. wxga
  275. 1366x768
  276.  
  277. wsxga
  278. 1600x1024
  279.  
  280. wuxga
  281. 1920x1200
  282.  
  283. woxga
  284. 2560x1600
  285.  
  286. wqsxga
  287. 3200x2048
  288.  
  289. wquxga
  290. 3840x2400
  291.  
  292. whsxga
  293. 6400x4096
  294.  
  295. whuxga
  296. 7680x4800
  297.  
  298. cga 320x200
  299.  
  300. ega 640x350
  301.  
  302. hd480
  303. 852x480
  304.  
  305. hd720
  306. 1280x720
  307.  
  308. hd1080
  309. 1920x1080
  310.  
  311. -aspect aspect
  312. Set the video display aspect ratio specified by aspect.
  313.  
  314. aspect can be a floating point number string, or a string of the form num:den, where num and den are the numerator and denominator of the aspect ratio. For example
  315. "4:3", "16:9", "1.3333", and "1.7777" are valid argument values.
  316.  
  317. -croptop size
  318. -cropbottom size
  319. -cropleft size
  320. -cropright size
  321. All the crop options have been removed. Use -vf crop=width:height:x:y instead.
  322.  
  323. -padtop size
  324. -padbottom size
  325. -padleft size
  326. -padright size
  327. -padcolor hex_color
  328. All the pad options have been removed. Use -vf pad=width:height:x:y:color instead.
  329.  
  330. -vn Disable video recording.
  331.  
  332. -bt tolerance
  333. 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
  334. 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
  335. quality.
  336.  
  337. -maxrate bitrate
  338. Set max video bitrate (in bit/s). Requires -bufsize to be set.
  339.  
  340. -minrate bitrate
  341. Set min video bitrate (in bit/s). Most useful in setting up a CBR encode:
  342.  
  343. ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  344.  
  345. It is of little use elsewise.
  346.  
  347. -bufsize size
  348. Set video buffer verifier buffer size (in bits).
  349.  
  350. -vcodec codec
  351. Force video codec to codec. Use the "copy" special value to tell that the raw codec data must be copied as is.
  352.  
  353. -sameq
  354. Use same quantizer as source (implies VBR).
  355.  
  356. -pass n
  357. 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
  358. 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
  359. set output to null, examples for Windows and Unix:
  360.  
  361. ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
  362. ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
  363.  
  364. -passlogfile prefix
  365. 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
  366. specific to the output stream.
  367.  
  368. -newvideo
  369. Add a new video stream to the current output stream.
  370.  
  371. -vlang code
  372. Set the ISO 639 language code (3 letters) of the current video stream.
  373.  
  374. -vf filter_graph
  375. 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
  376. and sinks).
  377.  
  378. Advanced Video Options
  379. -pix_fmt format
  380. Set pixel format. Use 'list' as parameter to show all the supported pixel formats.
  381.  
  382. -sws_flags flags
  383. Set SwScaler flags.
  384.  
  385. -g gop_size
  386. Set the group of pictures size.
  387.  
  388. -intra
  389. Use only intra frames.
  390.  
  391. -vdt n
  392. Discard threshold.
  393.  
  394. -qscale q
  395. Use fixed video quantizer scale (VBR).
  396.  
  397. -qmin q
  398. minimum video quantizer scale (VBR)
  399.  
  400. -qmax q
  401. maximum video quantizer scale (VBR)
  402.  
  403. -qdiff q
  404. maximum difference between the quantizer scales (VBR)
  405.  
  406. -qblur blur
  407. video quantizer scale blur (VBR) (range 0.0 - 1.0)
  408.  
  409. -qcomp compression
  410. video quantizer scale compression (VBR) (default 0.5). Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
  411.  
  412. -lmin lambda
  413. minimum video lagrange factor (VBR)
  414.  
  415. -lmax lambda
  416. max video lagrange factor (VBR)
  417.  
  418. -mblmin lambda
  419. minimum macroblock quantizer scale (VBR)
  420.  
  421. -mblmax lambda
  422. maximum macroblock quantizer scale (VBR)
  423.  
  424. These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units, but you may use the QP2LAMBDA constant to easily convert from 'q' units:
  425.  
  426. ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  427.  
  428. -rc_init_cplx complexity
  429. initial complexity for single pass encoding
  430.  
  431. -b_qfactor factor
  432. qp factor between P- and B-frames
  433.  
  434. -i_qfactor factor
  435. qp factor between P- and I-frames
  436.  
  437. -b_qoffset offset
  438. qp offset between P- and B-frames
  439.  
  440. -i_qoffset offset
  441. qp offset between P- and I-frames
  442.  
  443. -rc_eq equation
  444. Set rate control equation (see section "Expression Evaluation") (default = "tex^qComp").
  445.  
  446. When computing the rate control equation expression, besides the standard functions defined in the section "Expression Evaluation", the following functions are
  447. available:
  448.  
  449. bits2qp(bits)
  450. qp2bits(qp)
  451.  
  452. and the following constants are available:
  453.  
  454. iTex
  455. pTex
  456. tex
  457. mv
  458. fCode
  459. iCount
  460. mcVar
  461. var
  462. isI
  463. isP
  464. isB
  465. avgQP
  466. qComp
  467. avgIITex
  468. avgPITex
  469. avgPPTex
  470. avgBPTex
  471. avgTex
  472. -rc_override override
  473. rate control override for specific intervals
  474.  
  475. -me_method method
  476. Set motion estimation method to method. Available methods are (from lowest to best quality):
  477.  
  478. zero
  479. Try just the (0, 0) vector.
  480.  
  481. phods
  482. log
  483. x1
  484. hex
  485. umh
  486. epzs
  487. (default method)
  488.  
  489. full
  490. exhaustive search (slow and marginally better than epzs)
  491.  
  492. -dct_algo algo
  493. Set DCT algorithm to algo. Available values are:
  494.  
  495. 0 FF_DCT_AUTO (default)
  496.  
  497. 1 FF_DCT_FASTINT
  498.  
  499. 2 FF_DCT_INT
  500.  
  501. 3 FF_DCT_MMX
  502.  
  503. 4 FF_DCT_MLIB
  504.  
  505. 5 FF_DCT_ALTIVEC
  506.  
  507. -idct_algo algo
  508. Set IDCT algorithm to algo. Available values are:
  509.  
  510. 0 FF_IDCT_AUTO (default)
  511.  
  512. 1 FF_IDCT_INT
  513.  
  514. 2 FF_IDCT_SIMPLE
  515.  
  516. 3 FF_IDCT_SIMPLEMMX
  517.  
  518. 4 FF_IDCT_LIBMPEG2MMX
  519.  
  520. 5 FF_IDCT_PS2
  521.  
  522. 6 FF_IDCT_MLIB
  523.  
  524. 7 FF_IDCT_ARM
  525.  
  526. 8 FF_IDCT_ALTIVEC
  527.  
  528. 9 FF_IDCT_SH4
  529.  
  530. 10 FF_IDCT_SIMPLEARM
  531.  
  532. -er n
  533. Set error resilience to n.
  534.  
  535. 1 FF_ER_CAREFUL (default)
  536.  
  537. 2 FF_ER_COMPLIANT
  538.  
  539. 3 FF_ER_AGGRESSIVE
  540.  
  541. 4 FF_ER_EXPLODE
  542.  
  543. -ec bit_mask
  544. Set error concealment to bit_mask. bit_mask is a bit mask of the following values:
  545.  
  546. 1 FF_EC_GUESS_MVS (default = enabled)
  547.  
  548. 2 FF_EC_DEBLOCK (default = enabled)
  549.  
  550. -bf frames
  551. Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
  552.  
  553. -mbd mode
  554. macroblock decision
  555.  
  556. 0 FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in ffmpeg).
  557.  
  558. 1 FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
  559.  
  560. 2 FF_MB_DECISION_RD: rate distortion
  561.  
  562. -4mv
  563. Use four motion vector by macroblock (MPEG-4 only).
  564.  
  565. -part
  566. Use data partitioning (MPEG-4 only).
  567.  
  568. -bug param
  569. Work around encoder bugs that are not auto-detected.
  570.  
  571. -strict strictness
  572. How strictly to follow the standards.
  573.  
  574. -aic
  575. Enable Advanced intra coding (h263+).
  576.  
  577. -umv
  578. Enable Unlimited Motion Vector (h263+)
  579.  
  580. -deinterlace
  581. Deinterlace pictures.
  582.  
  583. -ilme
  584. 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
  585. minimum losses. The alternative is to deinterlace the input stream with -deinterlace, but deinterlacing introduces losses.
  586.  
  587. -psnr
  588. Calculate PSNR of compressed frames.
  589.  
  590. -vstats
  591. Dump video coding statistics to vstats_HHMMSS.log.
  592.  
  593. -vstats_file file
  594. Dump video coding statistics to file.
  595.  
  596. -top n
  597. top=1/bottom=0/auto=-1 field first
  598.  
  599. -dc precision
  600. Intra_dc_precision.
  601.  
  602. -vtag fourcc/tag
  603. Force video tag/fourcc.
  604.  
  605. -qphist
  606. Show QP histogram.
  607.  
  608. -vbsf bitstream_filter
  609. Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg".
  610.  
  611. ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
  612.  
  613. -force_key_frames time[,time...]
  614. 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
  615. present at a chapter mark or any other designated place in the output file. The timestamps must be specified in ascending order.
  616.  
  617. Audio Options
  618. -aframes number
  619. Set the number of audio frames to record.
  620.  
  621. -ar freq
  622. Set the audio sampling frequency. For output streams it is set by default to the frequency of the corresponding input stream. For input streams this option only makes
  623. sense for audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options.
  624.  
  625. -aq q
  626. Set the audio quality (codec-specific, VBR).
  627.  
  628. -ac channels
  629. Set the number of audio channels. For output streams it is set by default to the number of input audio channels. For input streams this option only makes sense for
  630. audio grabbing devices and raw demuxers and is mapped to the corresponding demuxer options.
  631.  
  632. -an Disable audio recording.
  633.  
  634. -acodec codec
  635. Force audio codec to codec. Use the "copy" special value to specify that the raw codec data must be copied as is.
  636.  
  637. -newaudio
  638. Add a new audio track to the output file. If you want to specify parameters, do so before "-newaudio" ("-acodec", "-ab", etc..).
  639.  
  640. 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
  641. override the mapping using "-map" as usual.
  642.  
  643. Example:
  644.  
  645. ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
  646.  
  647. -alang code
  648. Set the ISO 639 language code (3 letters) of the current audio stream.
  649.  
  650. Advanced Audio options:
  651. -atag fourcc/tag
  652. Force audio tag/fourcc.
  653.  
  654. -audio_service_type type
  655. Set the type of service that the audio stream contains.
  656.  
  657. ma Main Audio Service (default)
  658.  
  659. ef Effects
  660.  
  661. vi Visually Impaired
  662.  
  663. hi Hearing Impaired
  664.  
  665. di Dialogue
  666.  
  667. co Commentary
  668.  
  669. em Emergency
  670.  
  671. vo Voice Over
  672.  
  673. ka Karaoke
  674.  
  675. -absf bitstream_filter
  676. Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
  677.  
  678. Subtitle options:
  679. -scodec codec
  680. Force subtitle codec ('copy' to copy stream).
  681.  
  682. -newsubtitle
  683. Add a new subtitle stream to the current output stream.
  684.  
  685. -slang code
  686. Set the ISO 639 language code (3 letters) of the current subtitle stream.
  687.  
  688. -sn Disable subtitle recording.
  689.  
  690. -sbsf bitstream_filter
  691. Bitstream filters available are "mov2textsub", "text2movsub".
  692.  
  693. ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
  694.  
  695. Audio/Video grab options
  696. -vc channel
  697. Set video grab channel (DV1394 only).
  698.  
  699. -tvstd standard
  700. Set television standard (NTSC, PAL (SECAM)).
  701.  
  702. -isync
  703. Synchronize read on input.
  704.  
  705. Advanced options
  706. -map input_file_id.input_stream_id[:sync_file_id.sync_stream_id]
  707. Designate an input stream as a source for the output file. Each input stream is identified by the input file index input_file_id and the input stream index
  708. input_stream_id within the input file. Both indexes start at 0. If specified, sync_file_id.sync_stream_id sets which input stream is used as a presentation sync
  709. reference.
  710.  
  711. The "-map" options must be specified just after the output file. If any "-map" options are used, the number of "-map" options on the command line must match the
  712. number of streams in the output file. The first "-map" option on the command line specifies the source for output stream 0, the second "-map" option specifies the
  713. source for output stream 1, etc.
  714.  
  715. For example, if you have two audio streams in the first input file, these streams are identified by "0.0" and "0.1". You can use "-map" to select which stream to
  716. place in an output file. For example:
  717.  
  718. ffmpeg -i INPUT out.wav -map 0.1
  719.  
  720. will map the input stream in INPUT identified by "0.1" to the (single) output stream in out.wav.
  721.  
  722. For example, to select the stream with index 2 from input file a.mov (specified by the identifier "0.2"), and stream with index 6 from input b.mov (specified by the
  723. identifier "1.6"), and copy them to the output file out.mov:
  724.  
  725. ffmpeg -i a.mov -i b.mov -vcodec copy -acodec copy out.mov -map 0.2 -map 1.6
  726.  
  727. To add more streams to the output file, you can use the "-newaudio", "-newvideo", "-newsubtitle" options.
  728.  
  729. -map_meta_data outfile[,metadata]:infile[,metadata]
  730. Deprecated, use -map_metadata instead.
  731.  
  732. -map_metadata outfile[,metadata]:infile[,metadata]
  733. Set metadata information of outfile from infile. Note that those are file indices (zero-based), not filenames. Optional metadata parameters specify, which metadata
  734. 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
  735. followed by the stream/chapter/program number. If metadata specifier is omitted, it defaults to global.
  736.  
  737. 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
  738. 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
  739. copying.
  740.  
  741. For example to copy metadata from the first stream of the input file to global metadata of the output file:
  742.  
  743. ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
  744.  
  745. -map_chapters outfile:infile
  746. 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
  747. files. Use a negative file index to disable any chapter copying.
  748.  
  749. -debug
  750. Print specific debug info.
  751.  
  752. -benchmark
  753. 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
  754. systems, it will usually display as 0 if not supported.
  755.  
  756. -dump
  757. Dump each input packet.
  758.  
  759. -hex
  760. When dumping packets, also dump the payload.
  761.  
  762. -bitexact
  763. Only use bit exact algorithms (for codec testing).
  764.  
  765. -ps size
  766. Set RTP payload size in bytes.
  767.  
  768. -re Read input at native frame rate. Mainly used to simulate a grab device.
  769.  
  770. -loop_input
  771. Loop over the input stream. Currently it works only for image streams. This option is used for automatic AVserver testing. This option is deprecated, use -loop.
  772.  
  773. -loop_output number_of_times
  774. Repeatedly loop output for formats that support looping such as animated GIF (0 will loop the output infinitely). This option is deprecated, use -loop.
  775.  
  776. -threads count
  777. Thread count.
  778.  
  779. -vsync parameter
  780. Video sync method.
  781.  
  782. 0 Each frame is passed with its timestamp from the demuxer to the muxer.
  783.  
  784. 1 Frames will be duplicated and dropped to achieve exactly the requested constant framerate.
  785.  
  786. 2 Frames are passed through with their timestamp or dropped so as to prevent 2 frames from having the same timestamp.
  787.  
  788. -1 Chooses between 1 and 2 depending on muxer capabilities. This is the default method.
  789.  
  790. 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
  791. unchanged one.
  792.  
  793. -async samples_per_second
  794. 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.
  795. -async 1 is a special case where only the start of the audio stream is corrected without any later correction.
  796.  
  797. -copyts
  798. Copy timestamps from input to output.
  799.  
  800. -copytb
  801. Copy input stream time base from input to output when stream copying.
  802.  
  803. -shortest
  804. Finish encoding when the shortest input stream ends.
  805.  
  806. -dts_delta_threshold
  807. Timestamp discontinuity delta threshold.
  808.  
  809. -muxdelay seconds
  810. Set the maximum demux-decode delay.
  811.  
  812. -muxpreload seconds
  813. Set the initial demux-decode delay.
  814.  
  815. -streamid output-stream-index:new-value
  816. Assign a new stream-id value to an output stream. This option should be specified prior to the output filename to which it applies. For the situation where multiple
  817. output files exist, a streamid may be reassigned to a different value.
  818.  
  819. For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for an output mpegts file:
  820.  
  821. ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
  822.  
  823. Preset files
  824. 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
  825. starting with the hash ('#') character are ignored and are used to provide comments. Check the presets directory in the Libav source tree for examples.
  826.  
  827. 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
  828. 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
  829. same type as the preset option.
  830.  
  831. The argument passed to the "vpre", "apre", and "spre" preset options identifies the preset file to use according to the following rules:
  832.  
  833. First ffmpeg searches for a file named arg.ffpreset in the directories $AVCONV_DATADIR (if set), and $HOME/.avconv, and in the datadir defined at configuration time
  834. (usually PREFIX/share/avconv) in that order. For example, if the argument is "libx264-max", it will search for the file libx264-max.ffpreset.
  835.  
  836. 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
  837. 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
  838. libx264-max.ffpreset.
  839.  
  840. TIPS
  841. · For streaming at very low bitrate application, use a low frame rate and a small GOP size. This is especially true for RealVideo where the Linux player does not seem
  842. to be very fast, so it can miss frames. An example is:
  843.  
  844. ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
  845.  
  846. · The parameter 'q' which is displayed while encoding is the current quantizer. The value 1 indicates that a very good quality could be achieved. The value 31 indicates
  847. the worst quality. If q=31 appears too often, it means that the encoder cannot compress enough to meet your bitrate. You must either increase the bitrate, decrease
  848. the frame rate or decrease the frame size.
  849.  
  850. · If your computer is not fast enough, you can speed up the compression at the expense of the compression ratio. You can use '-me zero' to speed up motion estimation,
  851. and '-intra' to disable motion estimation completely (you have only I-frames, which means it is about as good as JPEG compression).
  852.  
  853. · To have very low audio bitrates, reduce the sampling frequency (down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
  854.  
  855. · To have a constant quality (but a variable bitrate), use the option '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst quality).
  856.  
  857. · When converting video files, you can use the '-sameq' option which uses the same quality factor in the encoder as in the decoder. It allows almost lossless encoding.
  858.  
  859. EXAMPLES
  860. Video and Audio grabbing
  861. If you specify the input format and device then ffmpeg can grab video and audio directly.
  862.  
  863. ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  864.  
  865. Note that you must activate the right video source and channel before launching ffmpeg with any TV viewer such as
  866. xawtv ("http://linux.bytesex.org/xawtv/") by Gerd Knorr. You also have to set the audio recording levels correctly with a standard mixer.
  867.  
  868. X11 grabbing
  869. Grab the X11 display with ffmpeg via
  870.  
  871. ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
  872.  
  873. 0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable.
  874.  
  875. ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
  876.  
  877. 10 is the x-offset and 20 the y-offset for the grabbing.
  878.  
  879. ffmpeg -f x11grab -follow_mouse centered -s cif -r 25 -i :0.0 /tmp/out.mpg
  880.  
  881. The grabbing region follows the mouse pointer, which stays at the center of region.
  882.  
  883. ffmpeg -f x11grab -follow_mouse 100 -s cif -r 25 -i :0.0 /tmp/out.mpg
  884.  
  885. Only follows when mouse pointer reaches within 100 pixels to the edge of region.
  886.  
  887. ffmpeg -f x11grab -show_region 1 -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
  888.  
  889. The grabbing region will be indicated on screen.
  890.  
  891. ffmpeg -f x11grab -follow_mouse centered -show_region 1 -s cif -r 25 -i :0.0 /tmp/out.mpg
  892.  
  893. The grabbing region indication will follow the mouse pointer.
  894.  
  895. Video and Audio file format conversion
  896. Any supported file format and protocol can serve as input to ffmpeg:
  897.  
  898. Examples:
  899.  
  900. · You can use YUV files as input:
  901.  
  902. ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  903.  
  904. It will use the files:
  905.  
  906. /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  907. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  908.  
  909. The Y files use twice the resolution of the U and V files. They are raw files, without header. They can be generated by all decent video decoders. You must specify
  910. the size of the image with the -s option if ffmpeg cannot guess it.
  911.  
  912. · You can input from a raw YUV420P file:
  913.  
  914. ffmpeg -i /tmp/test.yuv /tmp/out.avi
  915.  
  916. test.yuv is a file containing raw YUV planar data. Each frame is composed of the Y plane followed by the U and V planes at half vertical and horizontal resolution.
  917.  
  918. · You can output to a raw YUV420P file:
  919.  
  920. ffmpeg -i mydivx.avi hugefile.yuv
  921.  
  922. · You can set several input files and output files:
  923.  
  924. ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  925.  
  926. Converts the audio file a.wav and the raw YUV video file a.yuv to MPEG file a.mpg.
  927.  
  928. · You can also do audio and video conversions at the same time:
  929.  
  930. ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  931.  
  932. Converts a.wav to MPEG audio at 22050 Hz sample rate.
  933.  
  934. · You can encode to several formats at the same time and define a mapping from input stream to output streams:
  935.  
  936. ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
  937.  
  938. Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map file:index' specifies which input stream is used for each output stream, in the order of the
  939. definition of output streams.
  940.  
  941. · You can transcode decrypted VOBs:
  942.  
  943. ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
  944.  
  945. This is a typical DVD ripping example; the input is a VOB file, the output an AVI file with MPEG-4 video and MP3 audio. Note that in this command we use B-frames so
  946. the MPEG-4 stream is DivX5 compatible, and GOP size is 300 which means one intra frame every 10 seconds for 29.97fps input video. Furthermore, the audio stream is
  947. MP3-encoded so you need to enable LAME support by passing "--enable-libmp3lame" to configure. The mapping is particularly useful for DVD transcoding to get the
  948. desired audio language.
  949.  
  950. NOTE: To see the supported input formats, use "ffmpeg -formats".
  951.  
  952. · You can extract images from a video, or create a video from many images:
  953.  
  954. For extracting images from a video:
  955.  
  956. ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  957.  
  958. This will extract one video frame per second from the video and will output them in files named foo-001.jpeg, foo-002.jpeg, etc. Images will be rescaled to fit the
  959. new WxH values.
  960.  
  961. If you want to extract just a limited number of frames, you can use the above command in combination with the -vframes or -t option, or in combination with -ss to
  962. start extracting from a certain point in time.
  963.  
  964. For creating a video from many images:
  965.  
  966. ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
  967.  
  968. The syntax "foo-%03d.jpeg" specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax
  969. supported by the C printf function, but only formats accepting a normal integer are suitable.
  970.  
  971. · You can put many streams of the same type in the output:
  972.  
  973. ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
  974.  
  975. In addition to the first video and audio streams, the resulting output file test12.avi will contain the second video and the second audio stream found in the input
  976. streams list.
  977.  
  978. The "-newvideo", "-newaudio" and "-newsubtitle" options have to be specified immediately after the name of the output file to which you want to add them.
  979.  
  980. EXPRESSION EVALUATION
  981. When evaluating an arithmetic expression, Libav uses an internal formula evaluator, implemented through the libavutil/eval.h interface.
  982.  
  983. An expression may contain unary, binary operators, constants, and functions.
  984.  
  985. Two expressions expr1 and expr2 can be combined to form another expression "expr1;expr2". expr1 and expr2 are evaluated in turn, and the new expression evaluates to the
  986. value of expr2.
  987.  
  988. The following binary operators are available: "+", "-", "*", "/", "^".
  989.  
  990. The following unary operators are available: "+", "-".
  991.  
  992. The following functions are available:
  993.  
  994. sinh(x)
  995. cosh(x)
  996. tanh(x)
  997. sin(x)
  998. cos(x)
  999. tan(x)
  1000. atan(x)
  1001. asin(x)
  1002. acos(x)
  1003. exp(x)
  1004. log(x)
  1005. abs(x)
  1006. squish(x)
  1007. gauss(x)
  1008. isnan(x)
  1009. Return 1.0 if x is NAN, 0.0 otherwise.
  1010.  
  1011. mod(x, y)
  1012. max(x, y)
  1013. min(x, y)
  1014. eq(x, y)
  1015. gte(x, y)
  1016. gt(x, y)
  1017. lte(x, y)
  1018. lt(x, y)
  1019. st(var, expr)
  1020. Allow to store the value of the expression expr in an internal variable. var specifies the number of the variable where to store the value, and it is a value ranging
  1021. from 0 to 9. The function returns the value stored in the internal variable.
  1022.  
  1023. ld(var)
  1024. Allow to load the value of the internal variable with number var, which was previously stored with st(var, expr). The function returns the loaded value.
  1025.  
  1026. while(cond, expr)
  1027. Evaluate expression expr while the expression cond is non-zero, and returns the value of the last expr evaluation, or NAN if cond was always false.
  1028.  
  1029. ceil(expr)
  1030. Round the value of expression expr upwards to the nearest integer. For example, "ceil(1.5)" is "2.0".
  1031.  
  1032. floor(expr)
  1033. Round the value of expression expr downwards to the nearest integer. For example, "floor(-1.5)" is "-2.0".
  1034.  
  1035. trunc(expr)
  1036. Round the value of expression expr towards zero to the nearest integer. For example, "trunc(-1.5)" is "-1.0".
  1037.  
  1038. sqrt(expr)
  1039. Compute the square root of expr. This is equivalent to "(expr)^.5".
  1040.  
  1041. not(expr)
  1042. Return 1.0 if expr is zero, 0.0 otherwise.
  1043.  
  1044. Note that:
  1045.  
  1046. "*" works like AND
  1047.  
  1048. "+" works like OR
  1049.  
  1050. thus
  1051.  
  1052. if A then B else C
  1053.  
  1054. is equivalent to
  1055.  
  1056. A*B + not(A)*C
  1057.  
  1058. In your C code, you can extend the list of unary and binary functions, and define recognized constants, so that they are available for your expressions.
  1059.  
  1060. The evaluator also recognizes the International System number postfixes. If 'i' is appended after the postfix, powers of 2 are used instead of powers of 10. The 'B'
  1061. 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.
  1062.  
  1063. Follows the list of available International System postfixes, with indication of the corresponding powers of 10 and of 2.
  1064.  
  1065. y -24 / -80
  1066.  
  1067. z -21 / -70
  1068.  
  1069. a -18 / -60
  1070.  
  1071. f -15 / -50
  1072.  
  1073. p -12 / -40
  1074.  
  1075. n -9 / -30
  1076.  
  1077. u -6 / -20
  1078.  
  1079. m -3 / -10
  1080.  
  1081. c -2
  1082.  
  1083. d -1
  1084.  
  1085. h 2
  1086.  
  1087. k 3 / 10
  1088.  
  1089. K 3 / 10
  1090.  
  1091. M 6 / 20
  1092.  
  1093. G 9 / 30
  1094.  
  1095. T 12 / 40
  1096.  
  1097. P 15 / 40
  1098.  
  1099. E 18 / 50
  1100.  
  1101. Z 21 / 60
  1102.  
  1103. Y 24 / 70
  1104.  
  1105. ENCODERS
  1106. Encoders are configured elements in Libav which allow the encoding of multimedia streams.
  1107.  
  1108. When you configure your Libav build, all the supported native encoders are enabled by default. Encoders requiring an external library must be enabled manually via the
  1109. corresponding "--enable-lib" option. You can list all available encoders using the configure option "--list-encoders".
  1110.  
  1111. You can disable all the encoders with the configure option "--disable-encoders" and selectively enable / disable single encoders with the options
  1112. "--enable-encoder=ENCODER" / "--disable-encoder=ENCODER".
  1113.  
  1114. The option "-codecs" of the av* tools will display the list of enabled encoders.
  1115.  
  1116. AUDIO ENCODERS
  1117. A description of some of the currently available audio encoders follows.
  1118.  
  1119. ac3 and ac3_fixed
  1120. AC-3 audio encoders.
  1121.  
  1122. These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as the undocumented RealAudio 3 (a.k.a. dnet).
  1123.  
  1124. The ac3 encoder uses floating-point math, while the ac3_fixed encoder only uses fixed-point integer math. This does not mean that one is always faster, just that one or
  1125. the other may be better suited to a particular system. The floating-point encoder will generally produce better quality audio for a given bitrate. The ac3_fixed encoder
  1126. is not the default codec for any of the output formats, so it must be specified explicitly using the option "-acodec ac3_fixed" in order to use it.
  1127.  
  1128. AC-3 Metadata
  1129.  
  1130. The AC-3 metadata options are used to set parameters that describe the audio, but in most cases do not affect the audio encoding itself. Some of the options do directly
  1131. affect or influence the decoding and playback of the resulting bitstream, while others are just for informational purposes. A few of the options will add bits to the
  1132. output stream that could otherwise be used for audio data, and will thus affect the quality of the output. Those will be indicated accordingly with a note in the option
  1133. list below.
  1134.  
  1135. These parameters are described in detail in several publicly-available documents.
  1136.  
  1137. *<A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard ("http://www.atsc.org/cms/standards/a_52-2010.pdf")>
  1138. *<A/54 - Guide to the Use of the ATSC Digital Television Standard ("http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf")>
  1139. *<Dolby Metadata Guide ("http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf")>
  1140. *<Dolby Digital Professional Encoding Guidelines ("http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf")>
  1141.  
  1142. Metadata Control Options
  1143.  
  1144. -per_frame_metadata boolean
  1145. Allow Per-Frame Metadata. Specifies if the encoder should check for changing metadata for each frame.
  1146.  
  1147. 0 The metadata values set at initialization will be used for every frame in the stream. (default)
  1148.  
  1149. 1 Metadata values can be changed before encoding each frame.
  1150.  
  1151. Downmix Levels
  1152.  
  1153. -center_mixlev level
  1154. Center Mix Level. The amount of gain the decoder should apply to the center channel when downmixing to stereo. This field will only be written to the bitstream if a
  1155. center channel is present. The value is specified as a scale factor. There are 3 valid values:
  1156.  
  1157. 0.707
  1158. Apply -3dB gain
  1159.  
  1160. 0.595
  1161. Apply -4.5dB gain (default)
  1162.  
  1163. 0.500
  1164. Apply -6dB gain
  1165.  
  1166. -surround_mixlev level
  1167. Surround Mix Level. The amount of gain the decoder should apply to the surround channel(s) when downmixing to stereo. This field will only be written to the bitstream
  1168. if one or more surround channels are present. The value is specified as a scale factor. There are 3 valid values:
  1169.  
  1170. 0.707
  1171. Apply -3dB gain
  1172.  
  1173. 0.500
  1174. Apply -6dB gain (default)
  1175.  
  1176. 0.000
  1177. Silence Surround Channel(s)
  1178.  
  1179. Audio Production Information
  1180.  
  1181. Audio Production Information is optional information describing the mixing environment. Either none or both of the fields are written to the bitstream.
  1182.  
  1183. -mixing_level number
  1184. Mixing Level. Specifies peak sound pressure level (SPL) in the production environment when the mix was mastered. Valid values are 80 to 111, or -1 for unknown or not
  1185. indicated. The default value is -1, but that value cannot be used if the Audio Production Information is written to the bitstream. Therefore, if the "room_type"
  1186. option is not the default value, the "mixing_level" option must not be -1.
  1187.  
  1188. -room_type type
  1189. Room Type. Describes the equalization used during the final mixing session at the studio or on the dubbing stage. A large room is a dubbing stage with the industry
  1190. standard X-curve equalization; a small room has flat equalization. This field will not be written to the bitstream if both the "mixing_level" option and the
  1191. "room_type" option have the default values.
  1192.  
  1193. 0
  1194. notindicated
  1195. Not Indicated (default)
  1196.  
  1197. 1
  1198. large
  1199. Large Room
  1200.  
  1201. 2
  1202. small
  1203. Small Room
  1204.  
  1205. Other Metadata Options
  1206.  
  1207. -copyright boolean
  1208. Copyright Indicator. Specifies whether a copyright exists for this audio.
  1209.  
  1210. 0
  1211. off No Copyright Exists (default)
  1212.  
  1213. 1
  1214. on Copyright Exists
  1215.  
  1216. -dialnorm value
  1217. Dialogue Normalization. Indicates how far the average dialogue level of the program is below digital 100% full scale (0 dBFS). This parameter determines a level shift
  1218. during audio reproduction that sets the average volume of the dialogue to a preset level. The goal is to match volume level between program sources. A value of -31dB
  1219. will result in no volume level change, relative to the source volume, during audio reproduction. Valid values are whole numbers in the range -31 to -1, with -31 being
  1220. the default.
  1221.  
  1222. -dsur_mode mode
  1223. Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround (Pro Logic). This field will only be written to the bitstream if the audio stream is
  1224. stereo. Using this option does NOT mean the encoder will actually apply Dolby Surround processing.
  1225.  
  1226. 0
  1227. notindicated
  1228. Not Indicated (default)
  1229.  
  1230. 1
  1231. off Not Dolby Surround Encoded
  1232.  
  1233. 2
  1234. on Dolby Surround Encoded
  1235.  
  1236. -original boolean
  1237. Original Bit Stream Indicator. Specifies whether this audio is from the original source and not a copy.
  1238.  
  1239. 0
  1240. off Not Original Source
  1241.  
  1242. 1
  1243. on Original Source (default)
  1244.  
  1245. Extended Bitstream Information
  1246.  
  1247. The extended bitstream options are part of the Alternate Bit Stream Syntax as specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts. If any one
  1248. parameter in a group is specified, all values in that group will be written to the bitstream. Default values are used for those that are written but have not been
  1249. specified. If the mixing levels are written, the decoder will use these values instead of the ones specified in the "center_mixlev" and "surround_mixlev" options if it
  1250. supports the Alternate Bit Stream Syntax.
  1251.  
  1252. Extended Bitstream Information - Part 1
  1253.  
  1254. -dmix_mode mode
  1255. Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  1256.  
  1257. 0
  1258. notindicated
  1259. Not Indicated (default)
  1260.  
  1261. 1
  1262. ltrt
  1263. Lt/Rt Downmix Preferred
  1264.  
  1265. 2
  1266. loro
  1267. Lo/Ro Downmix Preferred
  1268.  
  1269. -ltrt_cmixlev level
  1270. Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the center channel when downmixing to stereo in Lt/Rt mode.
  1271.  
  1272. 1.414
  1273. Apply +3dB gain
  1274.  
  1275. 1.189
  1276. Apply +1.5dB gain
  1277.  
  1278. 1.000
  1279. Apply 0dB gain
  1280.  
  1281. 0.841
  1282. Apply -1.5dB gain
  1283.  
  1284. 0.707
  1285. Apply -3.0dB gain
  1286.  
  1287. 0.595
  1288. Apply -4.5dB gain (default)
  1289.  
  1290. 0.500
  1291. Apply -6.0dB gain
  1292.  
  1293. 0.000
  1294. Silence Center Channel
  1295.  
  1296. -ltrt_surmixlev level
  1297. Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the surround channel(s) when downmixing to stereo in Lt/Rt mode.
  1298.  
  1299. 0.841
  1300. Apply -1.5dB gain
  1301.  
  1302. 0.707
  1303. Apply -3.0dB gain
  1304.  
  1305. 0.595
  1306. Apply -4.5dB gain
  1307.  
  1308. 0.500
  1309. Apply -6.0dB gain (default)
  1310.  
  1311. 0.000
  1312. Silence Surround Channel(s)
  1313.  
  1314. -loro_cmixlev level
  1315. Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the center channel when downmixing to stereo in Lo/Ro mode.
  1316.  
  1317. 1.414
  1318. Apply +3dB gain
  1319.  
  1320. 1.189
  1321. Apply +1.5dB gain
  1322.  
  1323. 1.000
  1324. Apply 0dB gain
  1325.  
  1326. 0.841
  1327. Apply -1.5dB gain
  1328.  
  1329. 0.707
  1330. Apply -3.0dB gain
  1331.  
  1332. 0.595
  1333. Apply -4.5dB gain (default)
  1334.  
  1335. 0.500
  1336. Apply -6.0dB gain
  1337.  
  1338. 0.000
  1339. Silence Center Channel
  1340.  
  1341. -loro_surmixlev level
  1342. Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the surround channel(s) when downmixing to stereo in Lo/Ro mode.
  1343.  
  1344. 0.841
  1345. Apply -1.5dB gain
  1346.  
  1347. 0.707
  1348. Apply -3.0dB gain
  1349.  
  1350. 0.595
  1351. Apply -4.5dB gain
  1352.  
  1353. 0.500
  1354. Apply -6.0dB gain (default)
  1355.  
  1356. 0.000
  1357. Silence Surround Channel(s)
  1358.  
  1359. Extended Bitstream Information - Part 2
  1360.  
  1361. -dsurex_mode mode
  1362. Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX (7.1 matrixed to 5.1). Using this option does NOT mean the encoder will actually apply
  1363. Dolby Surround EX processing.
  1364.  
  1365. 0
  1366. notindicated
  1367. Not Indicated (default)
  1368.  
  1369. 1
  1370. on Dolby Surround EX Off
  1371.  
  1372. 2
  1373. off Dolby Surround EX On
  1374.  
  1375. -dheadphone_mode mode
  1376. Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone encoding (multi-channel matrixed to 2.0 for use with headphones). Using this option does NOT
  1377. mean the encoder will actually apply Dolby Headphone processing.
  1378.  
  1379. 0
  1380. notindicated
  1381. Not Indicated (default)
  1382.  
  1383. 1
  1384. on Dolby Headphone Off
  1385.  
  1386. 2
  1387. off Dolby Headphone On
  1388.  
  1389. -ad_conv_type type
  1390. A/D Converter Type. Indicates whether the audio has passed through HDCD A/D conversion.
  1391.  
  1392. 0
  1393. standard
  1394. Standard A/D Converter (default)
  1395.  
  1396. 1
  1397. hdcd
  1398. HDCD A/D Converter
  1399.  
  1400. Other AC-3 Encoding Options
  1401.  
  1402. -stereo_rematrixing boolean
  1403. Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This is an optional AC-3 feature that increases quality by selectively encoding the
  1404. left/right channels as mid/side. This option is enabled by default, and it is highly recommended that it be left as enabled except for testing purposes.
  1405.  
  1406. Floating-Point-Only AC-3 Encoding Options
  1407.  
  1408. These options are only valid for the floating-point encoder and do not exist for the fixed-point encoder due to the corresponding features not being implemented in fixed-
  1409. point.
  1410.  
  1411. -channel_coupling boolean
  1412. Enables/Disables use of channel coupling, which is an optional AC-3 feature that increases quality by combining high frequency information from multiple channels into
  1413. a single channel. The per-channel high frequency information is sent with less accuracy in both the frequency and time domains. This allows more bits to be used for
  1414. lower frequencies while preserving enough information to reconstruct the high frequencies. This option is enabled by default for the floating-point encoder and should
  1415. generally be left as enabled except for testing purposes or to increase encoding speed.
  1416.  
  1417. -1
  1418. auto
  1419. Selected by Encoder (default)
  1420.  
  1421. 0
  1422. off Disable Channel Coupling
  1423.  
  1424. 1
  1425. on Enable Channel Coupling
  1426.  
  1427. -cpl_start_band number
  1428. Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a value higher than the bandwidth is used, it will be reduced to 1 less than the coupling
  1429. end band. If auto is used, the start band will be determined by the encoder based on the bit rate, sample rate, and channel layout. This option has no effect if
  1430. channel coupling is disabled.
  1431.  
  1432. -1
  1433. auto
  1434. Selected by Encoder (default)
  1435.  
  1436. DEMUXERS
  1437. Demuxers are configured elements in Libav which allow to read the multimedia streams from a particular type of file.
  1438.  
  1439. When you configure your Libav build, all the supported demuxers are enabled by default. You can list all available ones using the configure option "--list-demuxers".
  1440.  
  1441. You can disable all the demuxers using the configure option "--disable-demuxers", and selectively enable a single demuxer with the option "--enable-demuxer=DEMUXER", or
  1442. disable it with the option "--disable-demuxer=DEMUXER".
  1443.  
  1444. The option "-formats" of the av* tools will display the list of enabled demuxers.
  1445.  
  1446. The description of some of the currently available demuxers follows.
  1447.  
  1448. image2
  1449. Image file demuxer.
  1450.  
  1451. This demuxer reads from a list of image files specified by a pattern.
  1452.  
  1453. The pattern may contain the string "%d" or "%0Nd", which specifies the position of the characters representing a sequential number in each filename matched by the
  1454. pattern. If the form "%d0Nd" is used, the string representing the number in each filename is 0-padded and N is the total number of 0-padded digits representing the
  1455. number. The literal character '%' can be specified in the pattern with the string "%%".
  1456.  
  1457. If the pattern contains "%d" or "%0Nd", the first filename of the file list specified by the pattern must contain a number inclusively contained between 0 and 4, all the
  1458. following numbers must be sequential. This limitation may be hopefully fixed.
  1459.  
  1460. The pattern may contain a suffix which is used to automatically determine the format of the images contained in the files.
  1461.  
  1462. For example the pattern "img-%03d.bmp" will match a sequence of filenames of the form img-001.bmp, img-002.bmp, ..., img-010.bmp, etc.; the pattern "i%%m%%g-%d.jpg" will
  1463. match a sequence of filenames of the form i%m%g-1.jpg, i%m%g-2.jpg, ..., i%m%g-10.jpg, etc.
  1464.  
  1465. The size, the pixel format, and the format of each image must be the same for all the files in the sequence.
  1466.  
  1467. The following example shows how to use avconv for creating a video from the images in the file sequence img-001.jpeg, img-002.jpeg, ..., assuming an input framerate of 10
  1468. frames per second:
  1469.  
  1470. avconv -i 'img-%03d.jpeg' -r 10 out.mkv
  1471.  
  1472. Note that the pattern must not necessarily contain "%d" or "%0Nd", for example to convert a single image file img.jpeg you can employ the command:
  1473.  
  1474. avconv -i img.jpeg img.png
  1475.  
  1476. applehttp
  1477. Apple HTTP Live Streaming demuxer.
  1478.  
  1479. This demuxer presents all AVStreams from all variant streams. The id field is set to the bitrate variant index number. By setting the discard flags on AVStreams (by
  1480. pressing 'a' or 'v' in avplay), the caller can decide which variant streams to actually receive. The total bitrate of the variant that the stream belongs to is available
  1481. in a metadata key named "variant_bitrate".
  1482.  
  1483. MUXERS
  1484. Muxers are configured elements in Libav which allow writing multimedia streams to a particular type of file.
  1485.  
  1486. When you configure your Libav build, all the supported muxers are enabled by default. You can list all available muxers using the configure option "--list-muxers".
  1487.  
  1488. You can disable all the muxers with the configure option "--disable-muxers" and selectively enable / disable single muxers with the options "--enable-muxer=MUXER" /
  1489. "--disable-muxer=MUXER".
  1490.  
  1491. The option "-formats" of the av* tools will display the list of enabled muxers.
  1492.  
  1493. A description of some of the currently available muxers follows.
  1494.  
  1495. crc
  1496. CRC (Cyclic Redundancy Check) testing format.
  1497.  
  1498. This muxer computes and prints the Adler-32 CRC of all the input audio and video frames. By default audio frames are converted to signed 16-bit raw audio and video frames
  1499. to raw video before computing the CRC.
  1500.  
  1501. The output of the muxer consists of a single line of the form: CRC=0xCRC, where CRC is a hexadecimal number 0-padded to 8 digits containing the CRC for all the decoded
  1502. input frames.
  1503.  
  1504. For example to compute the CRC of the input, and store it in the file out.crc:
  1505.  
  1506. avconv -i INPUT -f crc out.crc
  1507.  
  1508. You can print the CRC to stdout with the command:
  1509.  
  1510. avconv -i INPUT -f crc -
  1511.  
  1512. You can select the output format of each frame with avconv by specifying the audio and video codec and format. For example to compute the CRC of the input audio converted
  1513. to PCM unsigned 8-bit and the input video converted to MPEG-2 video, use the command:
  1514.  
  1515. avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  1516.  
  1517. See also the framecrc muxer.
  1518.  
  1519. framecrc
  1520. Per-frame CRC (Cyclic Redundancy Check) testing format.
  1521.  
  1522. This muxer computes and prints the Adler-32 CRC for each decoded audio and video frame. By default audio frames are converted to signed 16-bit raw audio and video frames
  1523. to raw video before computing the CRC.
  1524.  
  1525. The output of the muxer consists of a line for each audio and video frame of the form: stream_index, frame_dts, frame_size, 0xCRC, where CRC is a hexadecimal number
  1526. 0-padded to 8 digits containing the CRC of the decoded frame.
  1527.  
  1528. For example to compute the CRC of each decoded frame in the input, and store it in the file out.crc:
  1529.  
  1530. avconv -i INPUT -f framecrc out.crc
  1531.  
  1532. You can print the CRC of each decoded frame to stdout with the command:
  1533.  
  1534. avconv -i INPUT -f framecrc -
  1535.  
  1536. You can select the output format of each frame with avconv by specifying the audio and video codec and format. For example, to compute the CRC of each decoded input audio
  1537. frame converted to PCM unsigned 8-bit and of each decoded input video frame converted to MPEG-2 video, use the command:
  1538.  
  1539. avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  1540.  
  1541. See also the crc muxer.
  1542.  
  1543. image2
  1544. Image file muxer.
  1545.  
  1546. The image file muxer writes video frames to image files.
  1547.  
  1548. The output filenames are specified by a pattern, which can be used to produce sequentially numbered series of files. The pattern may contain the string "%d" or "%0Nd",
  1549. this string specifies the position of the characters representing a numbering in the filenames. If the form "%0Nd" is used, the string representing the number in each
  1550. filename is 0-padded to N digits. The literal character '%' can be specified in the pattern with the string "%%".
  1551.  
  1552. If the pattern contains "%d" or "%0Nd", the first filename of the file list specified will contain the number 1, all the following numbers will be sequential.
  1553.  
  1554. The pattern may contain a suffix which is used to automatically determine the format of the image files to write.
  1555.  
  1556. For example the pattern "img-%03d.bmp" will specify a sequence of filenames of the form img-001.bmp, img-002.bmp, ..., img-010.bmp, etc. The pattern "img%%-%d.jpg" will
  1557. specify a sequence of filenames of the form img%-1.jpg, img%-2.jpg, ..., img%-10.jpg, etc.
  1558.  
  1559. The following example shows how to use avconv for creating a sequence of files img-001.jpeg, img-002.jpeg, ..., taking one image every second from the input video:
  1560.  
  1561. avconv -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
  1562.  
  1563. Note that with avconv, if the format is not specified with the "-f" option and the output filename specifies an image file format, the image2 muxer is automatically
  1564. selected, so the previous command can be written as:
  1565.  
  1566. avconv -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
  1567.  
  1568. Note also that the pattern must not necessarily contain "%d" or "%0Nd", for example to create a single image file img.jpeg from the input video you can employ the
  1569. command:
  1570.  
  1571. avconv -i in.avi -f image2 -frames:v 1 img.jpeg
  1572.  
  1573. mpegts
  1574. MPEG transport stream muxer.
  1575.  
  1576. This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  1577.  
  1578. The muxer options are:
  1579.  
  1580. -mpegts_original_network_id number
  1581. Set the original_network_id (default 0x0001). This is unique identifier of a network in DVB. Its main use is in the unique identification of a service through the
  1582. path Original_Network_ID, Transport_Stream_ID.
  1583.  
  1584. -mpegts_transport_stream_id number
  1585. Set the transport_stream_id (default 0x0001). This identifies a transponder in DVB.
  1586.  
  1587. -mpegts_service_id number
  1588. Set the service_id (default 0x0001) also known as program in DVB.
  1589.  
  1590. -mpegts_pmt_start_pid number
  1591. Set the first PID for PMT (default 0x1000, max 0x1f00).
  1592.  
  1593. -mpegts_start_pid number
  1594. Set the first PID for data packets (default 0x0100, max 0x0f00).
  1595.  
  1596. The recognized metadata settings in mpegts muxer are "service_provider" and "service_name". If they are not set the default for "service_provider" is "Libav" and the
  1597. default for "service_name" is "Service01".
  1598.  
  1599. avconv -i file.mpg -c copy \
  1600. -mpegts_original_network_id 0x1122 \
  1601. -mpegts_transport_stream_id 0x3344 \
  1602. -mpegts_service_id 0x5566 \
  1603. -mpegts_pmt_start_pid 0x1500 \
  1604. -mpegts_start_pid 0x150 \
  1605. -metadata service_provider="Some provider" \
  1606. -metadata service_name="Some Channel" \
  1607. -y out.ts
  1608.  
  1609. null
  1610. Null muxer.
  1611.  
  1612. This muxer does not generate any output file, it is mainly useful for testing or benchmarking purposes.
  1613.  
  1614. For example to benchmark decoding with avconv you can use the command:
  1615.  
  1616. avconv -benchmark -i INPUT -f null out.null
  1617.  
  1618. Note that the above command does not read or write the out.null file, but specifying the output file is required by the avconv syntax.
  1619.  
  1620. Alternatively you can write the command as:
  1621.  
  1622. avconv -benchmark -i INPUT -f null -
  1623.  
  1624. matroska
  1625. Matroska container muxer.
  1626.  
  1627. This muxer implements the matroska and webm container specs.
  1628.  
  1629. The recognized metadata settings in this muxer are:
  1630.  
  1631. title=title name
  1632. Name provided to a single track
  1633.  
  1634. language=language name
  1635. Specifies the language of the track in the Matroska languages form
  1636.  
  1637. STEREO_MODE=mode
  1638. Stereo 3D video layout of two views in a single video track
  1639.  
  1640. mono
  1641. video is not stereo
  1642.  
  1643. left_right
  1644. Both views are arranged side by side, Left-eye view is on the left
  1645.  
  1646. bottom_top
  1647. Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  1648.  
  1649. top_bottom
  1650. Both views are arranged in top-bottom orientation, Left-eye view is on top
  1651.  
  1652. checkerboard_rl
  1653. Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  1654.  
  1655. checkerboard_lr
  1656. Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  1657.  
  1658. row_interleaved_rl
  1659. Each view is constituted by a row based interleaving, Right-eye view is first row
  1660.  
  1661. row_interleaved_lr
  1662. Each view is constituted by a row based interleaving, Left-eye view is first row
  1663.  
  1664. col_interleaved_rl
  1665. Both views are arranged in a column based interleaving manner, Right-eye view is first column
  1666.  
  1667. col_interleaved_lr
  1668. Both views are arranged in a column based interleaving manner, Left-eye view is first column
  1669.  
  1670. anaglyph_cyan_red
  1671. All frames are in anaglyph format viewable through red-cyan filters
  1672.  
  1673. right_left
  1674. Both views are arranged side by side, Right-eye view is on the left
  1675.  
  1676. anaglyph_green_magenta
  1677. All frames are in anaglyph format viewable through green-magenta filters
  1678.  
  1679. block_lr
  1680. Both eyes laced in one Block, Left-eye view is first
  1681.  
  1682. block_rl
  1683. Both eyes laced in one Block, Right-eye view is first
  1684.  
  1685. For example a 3D WebM clip can be created using the following command line:
  1686.  
  1687. avconv -i sample_left_right_clip.mpg -an -c:v libvpx -metadata STEREO_MODE=left_right -y stereo_clip.webm
  1688.  
  1689. segment
  1690. Basic stream segmenter.
  1691.  
  1692. The segmenter muxer outputs streams to a number of separate files of nearly fixed duration. Output filename pattern can be set in a fashion similar to image2.
  1693.  
  1694. Every segment starts with a video keyframe, if a video stream is present. The segment muxer works best with a single constant frame rate video.
  1695.  
  1696. Optionally it can generate a flat list of the created segments, one segment per line.
  1697.  
  1698. segment_format format
  1699. Override the inner container format, by default it is guessed by the filename extension.
  1700.  
  1701. segment_time t
  1702. Set segment duration to t seconds.
  1703.  
  1704. segment_list name
  1705. Generate also a listfile named name.
  1706.  
  1707. segment_list_size size
  1708. Overwrite the listfile once it reaches size entries.
  1709.  
  1710. avconv -i in.mkv -c copy -map 0 -f segment -list out.list out%03d.nut
  1711.  
  1712. INPUT DEVICES
  1713. Input devices are configured elements in Libav which allow to access the data coming from a multimedia device attached to your system.
  1714.  
  1715. When you configure your Libav build, all the supported input devices are enabled by default. You can list all available ones using the configure option "--list-indevs".
  1716.  
  1717. You can disable all the input devices using the configure option "--disable-indevs", and selectively enable an input device using the option "--enable-indev=INDEV", or
  1718. you can disable a particular input device using the option "--disable-indev=INDEV".
  1719.  
  1720. The option "-formats" of the av* tools will display the list of supported input devices (amongst the demuxers).
  1721.  
  1722. A description of the currently available input devices follows.
  1723.  
  1724. alsa
  1725. ALSA (Advanced Linux Sound Architecture) input device.
  1726.  
  1727. To enable this input device during configuration you need libasound installed on your system.
  1728.  
  1729. This device allows capturing from an ALSA device. The name of the device to capture has to be an ALSA card identifier.
  1730.  
  1731. An ALSA identifier has the syntax:
  1732.  
  1733. hw:<CARD>[,<DEV>[,<SUBDEV>]]
  1734.  
  1735. where the DEV and SUBDEV components are optional.
  1736.  
  1737. The three arguments (in order: CARD,DEV,SUBDEV) specify card number or identifier, device number and subdevice number (-1 means any).
  1738.  
  1739. To see the list of cards currently recognized by your system check the files /proc/asound/cards and /proc/asound/devices.
  1740.  
  1741. For example to capture with avconv from an ALSA device with card id 0, you may run the command:
  1742.  
  1743. avconv -f alsa -i hw:0 alsaout.wav
  1744.  
  1745. For more information see: <http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html>
  1746.  
  1747. bktr
  1748. BSD video input device.
  1749.  
  1750. dv1394
  1751. Linux DV 1394 input device.
  1752.  
  1753. fbdev
  1754. Linux framebuffer input device.
  1755.  
  1756. The Linux framebuffer is a graphic hardware-independent abstraction layer to show graphics on a computer monitor, typically on the console. It is accessed through a file
  1757. device node, usually /dev/fb0.
  1758.  
  1759. For more detailed information read the file Documentation/fb/framebuffer.txt included in the Linux source tree.
  1760.  
  1761. To record from the framebuffer device /dev/fb0 with avconv:
  1762.  
  1763. avconv -f fbdev -r 10 -i /dev/fb0 out.avi
  1764.  
  1765. You can take a single screenshot image with the command:
  1766.  
  1767. avconv -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
  1768.  
  1769. See also <http://linux-fbdev.sourceforge.net/>, and fbset(1).
  1770.  
  1771. jack
  1772. JACK input device.
  1773.  
  1774. To enable this input device during configuration you need libjack installed on your system.
  1775.  
  1776. A JACK input device creates one or more JACK writable clients, one for each audio channel, with name client_name:input_N, where client_name is the name provided by the
  1777. application, and N is a number which identifies the channel. Each writable client will send the acquired data to the Libav input device.
  1778.  
  1779. Once you have created one or more JACK readable clients, you need to connect them to one or more JACK writable clients.
  1780.  
  1781. To connect or disconnect JACK clients you can use the jack_connect and jack_disconnect programs, or do it through a graphical interface, for example with qjackctl.
  1782.  
  1783. To list the JACK clients and their properties you can invoke the command jack_lsp.
  1784.  
  1785. Follows an example which shows how to capture a JACK readable client with avconv.
  1786.  
  1787. # Create a JACK writable client with name "libav".
  1788. $ avconv -f jack -i libav -y out.wav
  1789.  
  1790. # Start the sample jack_metro readable client.
  1791. $ jack_metro -b 120 -d 0.2 -f 4000
  1792.  
  1793. # List the current JACK clients.
  1794. $ jack_lsp -c
  1795. system:capture_1
  1796. system:capture_2
  1797. system:playback_1
  1798. system:playback_2
  1799. libav:input_1
  1800. metro:120_bpm
  1801.  
  1802. # Connect metro to the avconv writable client.
  1803. $ jack_connect metro:120_bpm libav:input_1
  1804.  
  1805. For more information read: <http://jackaudio.org/>
  1806.  
  1807. libdc1394
  1808. IIDC1394 input device, based on libdc1394 and libraw1394.
  1809.  
  1810. oss
  1811. Open Sound System input device.
  1812.  
  1813. The filename to provide to the input device is the device node representing the OSS input device, and is usually set to /dev/dsp.
  1814.  
  1815. For example to grab from /dev/dsp using avconv use the command:
  1816.  
  1817. avconv -f oss -i /dev/dsp /tmp/oss.wav
  1818.  
  1819. For more information about OSS see: <http://manuals.opensound.com/usersguide/dsp.html>
  1820.  
  1821. pulse
  1822. pulseaudio input device.
  1823.  
  1824. To enable this input device during configuration you need libpulse-simple installed in your system.
  1825.  
  1826. The filename to provide to the input device is a source device or the string "default"
  1827.  
  1828. To list the pulse source devices and their properties you can invoke the command pactl list sources.
  1829.  
  1830. avconv -f pulse -i default /tmp/pulse.wav
  1831.  
  1832. server AVOption
  1833.  
  1834. The syntax is:
  1835.  
  1836. -server <server name>
  1837.  
  1838. Connects to a specific server.
  1839.  
  1840. name AVOption
  1841.  
  1842. The syntax is:
  1843.  
  1844. -name <application name>
  1845.  
  1846. Specify the application name pulse will use when showing active clients, by default it is "libav"
  1847.  
  1848. stream_name AVOption
  1849.  
  1850. The syntax is:
  1851.  
  1852. -stream_name <stream name>
  1853.  
  1854. Specify the stream name pulse will use when showing active streams, by default it is "record"
  1855.  
  1856. sample_rate AVOption
  1857.  
  1858. The syntax is:
  1859.  
  1860. -sample_rate <samplerate>
  1861.  
  1862. Specify the samplerate in Hz, by default 48kHz is used.
  1863.  
  1864. channels AVOption
  1865.  
  1866. The syntax is:
  1867.  
  1868. -channels <N>
  1869.  
  1870. Specify the channels in use, by default 2 (stereo) is set.
  1871.  
  1872. frame_size AVOption
  1873.  
  1874. The syntax is:
  1875.  
  1876. -frame_size <bytes>
  1877.  
  1878. Specify the number of byte per frame, by default it is set to 1024.
  1879.  
  1880. fragment_size AVOption
  1881.  
  1882. The syntax is:
  1883.  
  1884. -fragment_size <bytes>
  1885.  
  1886. Specify the minimal buffering fragment in pulseaudio, it will affect the audio latency. By default it is unset.
  1887.  
  1888. sndio
  1889. sndio input device.
  1890.  
  1891. To enable this input device during configuration you need libsndio installed on your system.
  1892.  
  1893. The filename to provide to the input device is the device node representing the sndio input device, and is usually set to /dev/audio0.
  1894.  
  1895. For example to grab from /dev/audio0 using avconv use the command:
  1896.  
  1897. avconv -f sndio -i /dev/audio0 /tmp/oss.wav
  1898.  
  1899. video4linux and video4linux2
  1900. Video4Linux and Video4Linux2 input video devices.
  1901.  
  1902. The name of the device to grab is a file device node, usually Linux systems tend to automatically create such nodes when the device (e.g. an USB webcam) is plugged into
  1903. the system, and has a name of the kind /dev/videoN, where N is a number associated to the device.
  1904.  
  1905. Video4Linux and Video4Linux2 devices only support a limited set of widthxheight sizes and framerates. You can check which are supported for example with the command dov4l
  1906. for Video4Linux devices and using -list_formats all for Video4Linux2 devices.
  1907.  
  1908. If the size for the device is set to 0x0, the input device will try to autodetect the size to use. Only for the video4linux2 device, if the frame rate is set to 0/0 the
  1909. input device will use the frame rate value already set in the driver.
  1910.  
  1911. Video4Linux support is deprecated since Linux 2.6.30, and will be dropped in later versions.
  1912.  
  1913. Follow some usage examples of the video4linux devices with the av* tools.
  1914.  
  1915. # Grab and show the input of a video4linux device, frame rate is set
  1916. # to the default of 25/1.
  1917. avplay -s 320x240 -f video4linux /dev/video0
  1918.  
  1919. # Grab and show the input of a video4linux2 device, autoadjust size.
  1920. avplay -f video4linux2 /dev/video0
  1921.  
  1922. # Grab and record the input of a video4linux2 device, autoadjust size,
  1923. # frame rate value defaults to 0/0 so it is read from the video4linux2
  1924. # driver.
  1925. avconv -f video4linux2 -i /dev/video0 out.mpeg
  1926.  
  1927. vfwcap
  1928. VfW (Video for Windows) capture input device.
  1929.  
  1930. The filename passed as input is the capture driver number, ranging from 0 to 9. You may use "list" as filename to print a list of drivers. Any other filename will be
  1931. interpreted as device number 0.
  1932.  
  1933. x11grab
  1934. X11 video input device.
  1935.  
  1936. This device allows to capture a region of an X11 display.
  1937.  
  1938. The filename passed as input has the syntax:
  1939.  
  1940. [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
  1941.  
  1942. hostname:display_number.screen_number specifies the X11 display name of the screen to grab from. hostname can be ommitted, and defaults to "localhost". The environment
  1943. variable DISPLAY contains the default display name.
  1944.  
  1945. x_offset and y_offset specify the offsets of the grabbed area with respect to the top-left border of the X11 screen. They default to 0.
  1946.  
  1947. Check the X11 documentation (e.g. man X) for more detailed information.
  1948.  
  1949. Use the dpyinfo program for getting basic information about the properties of your X11 display (e.g. grep for "name" or "dimensions").
  1950.  
  1951. For example to grab from :0.0 using avconv:
  1952.  
  1953. avconv -f x11grab -r 25 -s cif -i :0.0 out.mpg
  1954.  
  1955. # Grab at position 10,20.
  1956. avconv -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
  1957.  
  1958. follow_mouse AVOption
  1959.  
  1960. The syntax is:
  1961.  
  1962. -follow_mouse centered|<PIXELS>
  1963.  
  1964. When it is specified with "centered", the grabbing region follows the mouse pointer and keeps the pointer at the center of region; otherwise, the region follows only when
  1965. the mouse pointer reaches within PIXELS (greater than zero) to the edge of region.
  1966.  
  1967. For example:
  1968.  
  1969. avconv -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
  1970.  
  1971. # Follows only when the mouse pointer reaches within 100 pixels to edge
  1972. avconv -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
  1973.  
  1974. show_region AVOption
  1975.  
  1976. The syntax is:
  1977.  
  1978. -show_region 1
  1979.  
  1980. If show_region AVOption is specified with 1, then the grabbing region will be indicated on screen. With this option, it's easy to know what is being grabbed if only a
  1981. portion of the screen is grabbed.
  1982.  
  1983. For example:
  1984.  
  1985. avconv -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
  1986.  
  1987. # With follow_mouse
  1988. avconv -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
  1989.  
  1990. OUTPUT DEVICES
  1991. Output devices are configured elements in Libav which allow to write multimedia data to an output device attached to your system.
  1992.  
  1993. When you configure your Libav build, all the supported output devices are enabled by default. You can list all available ones using the configure option "--list-outdevs".
  1994.  
  1995. You can disable all the output devices using the configure option "--disable-outdevs", and selectively enable an output device using the option "--enable-outdev=OUTDEV",
  1996. or you can disable a particular input device using the option "--disable-outdev=OUTDEV".
  1997.  
  1998. The option "-formats" of the av* tools will display the list of enabled output devices (amongst the muxers).
  1999.  
  2000. A description of the currently available output devices follows.
  2001.  
  2002. alsa
  2003. ALSA (Advanced Linux Sound Architecture) output device.
  2004.  
  2005. oss
  2006. OSS (Open Sound System) output device.
  2007.  
  2008. sndio
  2009. sndio audio output device.
  2010.  
  2011. PROTOCOLS
  2012. Protocols are configured elements in Libav which allow to access resources which require the use of a particular protocol.
  2013.  
  2014. When you configure your Libav build, all the supported protocols are enabled by default. You can list all available ones using the configure option "--list-protocols".
  2015.  
  2016. You can disable all the protocols using the configure option "--disable-protocols", and selectively enable a protocol using the option "--enable-protocol=PROTOCOL", or
  2017. you can disable a particular protocol using the option "--disable-protocol=PROTOCOL".
  2018.  
  2019. The option "-protocols" of the av* tools will display the list of supported protocols.
  2020.  
  2021. A description of the currently available protocols follows.
  2022.  
  2023. applehttp
  2024. Read Apple HTTP Live Streaming compliant segmented stream as a uniform one. The M3U8 playlists describing the segments can be remote HTTP resources or local files,
  2025. accessed using the standard file protocol. HTTP is default, specific protocol can be declared by specifying "+proto" after the applehttp URI scheme name, where proto is
  2026. either "file" or "http".
  2027.  
  2028. applehttp://host/path/to/remote/resource.m3u8
  2029. applehttp+http://host/path/to/remote/resource.m3u8
  2030. applehttp+file://path/to/local/resource.m3u8
  2031.  
  2032. concat
  2033. Physical concatenation protocol.
  2034.  
  2035. Allow to read and seek from many resource in sequence as if they were a unique resource.
  2036.  
  2037. A URL accepted by this protocol has the syntax:
  2038.  
  2039. concat:<URL1>|<URL2>|...|<URLN>
  2040.  
  2041. where URL1, URL2, ..., URLN are the urls of the resource to be concatenated, each one possibly specifying a distinct protocol.
  2042.  
  2043. For example to read a sequence of files split1.mpeg, split2.mpeg, split3.mpeg with avplay use the command:
  2044.  
  2045. avplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  2046.  
  2047. Note that you may need to escape the character "|" which is special for many shells.
  2048.  
  2049. file
  2050. File access protocol.
  2051.  
  2052. Allow to read from or read to a file.
  2053.  
  2054. For example to read from a file input.mpeg with avconv use the command:
  2055.  
  2056. avconv -i file:input.mpeg output.mpeg
  2057.  
  2058. The av* tools default to the file protocol, that is a resource specified with the name "FILE.mpeg" is interpreted as the URL "file:FILE.mpeg".
  2059.  
  2060. gopher
  2061. Gopher protocol.
  2062.  
  2063. http
  2064. HTTP (Hyper Text Transfer Protocol).
  2065.  
  2066. mmst
  2067. MMS (Microsoft Media Server) protocol over TCP.
  2068.  
  2069. mmsh
  2070. MMS (Microsoft Media Server) protocol over HTTP.
  2071.  
  2072. The required syntax is:
  2073.  
  2074. mmsh://<server>[:<port>][/<app>][/<playpath>]
  2075.  
  2076. md5
  2077. MD5 output protocol.
  2078.  
  2079. Computes the MD5 hash of the data to be written, and on close writes this to the designated output or stdout if none is specified. It can be used to test muxers without
  2080. writing an actual file.
  2081.  
  2082. Some examples follow.
  2083.  
  2084. # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  2085. avconv -i input.flv -f avi -y md5:output.avi.md5
  2086.  
  2087. # Write the MD5 hash of the encoded AVI file to stdout.
  2088. avconv -i input.flv -f avi -y md5:
  2089.  
  2090. Note that some formats (typically MOV) require the output protocol to be seekable, so they will fail with the MD5 output protocol.
  2091.  
  2092. pipe
  2093. UNIX pipe access protocol.
  2094.  
  2095. Allow to read and write from UNIX pipes.
  2096.  
  2097. The accepted syntax is:
  2098.  
  2099. pipe:[<number>]
  2100.  
  2101. number is the number corresponding to the file descriptor of the pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number is not specified, by default the stdout
  2102. file descriptor will be used for writing, stdin for reading.
  2103.  
  2104. For example to read from stdin with avconv:
  2105.  
  2106. cat test.wav | avconv -i pipe:0
  2107. # ...this is the same as...
  2108. cat test.wav | avconv -i pipe:
  2109.  
  2110. For writing to stdout with avconv:
  2111.  
  2112. avconv -i test.wav -f avi pipe:1 | cat > test.avi
  2113. # ...this is the same as...
  2114. avconv -i test.wav -f avi pipe: | cat > test.avi
  2115.  
  2116. Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol.
  2117.  
  2118. rtmp
  2119. Real-Time Messaging Protocol.
  2120.  
  2121. The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia content across a TCP/IP network.
  2122.  
  2123. The required syntax is:
  2124.  
  2125. rtmp://<server>[:<port>][/<app>][/<playpath>]
  2126.  
  2127. The accepted parameters are:
  2128.  
  2129. server
  2130. The address of the RTMP server.
  2131.  
  2132. port
  2133. The number of the TCP port to use (by default is 1935).
  2134.  
  2135. app It is the name of the application to access. It usually corresponds to the path where the application is installed on the RTMP server (e.g. /ondemand/, /flash/live/,
  2136. etc.).
  2137.  
  2138. playpath
  2139. It is the path or name of the resource to play with reference to the application specified in app, may be prefixed by "mp4:".
  2140.  
  2141. For example to read with avplay a multimedia resource named "sample" from the application "vod" from an RTMP server "myserver":
  2142.  
  2143. avplay rtmp://myserver/vod/sample
  2144.  
  2145. rtmp, rtmpe, rtmps, rtmpt, rtmpte
  2146. Real-Time Messaging Protocol and its variants supported through librtmp.
  2147.  
  2148. Requires the presence of the librtmp headers and library during configuration. You need to explicitly configure the build with "--enable-librtmp". If enabled this will
  2149. replace the native RTMP protocol.
  2150.  
  2151. This protocol provides most client functions and a few server functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), encrypted RTMP (RTMPE), RTMP over SSL/TLS
  2152. (RTMPS) and tunneled variants of these encrypted types (RTMPTE, RTMPTS).
  2153.  
  2154. The required syntax is:
  2155.  
  2156. <rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options>
  2157.  
  2158. where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and server, port, app and playpath have
  2159. the same meaning as specified for the RTMP native protocol. options contains a list of space-separated options of the form key=val.
  2160.  
  2161. See the librtmp manual page (man 3 librtmp) for more information.
  2162.  
  2163. For example, to stream a file in real-time to an RTMP server using avconv:
  2164.  
  2165. avconv -re -i myfile -f flv rtmp://myserver/live/mystream
  2166.  
  2167. To play the same stream using avplay:
  2168.  
  2169. avplay "rtmp://myserver/live/mystream live=1"
  2170.  
  2171. rtp
  2172. Real-Time Protocol.
  2173.  
  2174. rtsp
  2175. RTSP is not technically a protocol handler in libavformat, it is a demuxer and muxer. The demuxer supports both normal RTSP (with data transferred over RTP; this is used
  2176. by e.g. Apple and Microsoft) and Real-RTSP (with data transferred over RDT).
  2177.  
  2178. The muxer can be used to send a stream using RTSP ANNOUNCE to a server supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
  2179. RTSP server ("http://github.com/revmischa/rtsp-server")).
  2180.  
  2181. The required syntax for a RTSP url is:
  2182.  
  2183. rtsp://<hostname>[:<port>]/<path>
  2184.  
  2185. The following options (set on the avconv/avplay command line, or set in code via "AVOption"s or in "avformat_open_input"), are supported:
  2186.  
  2187. Flags for "rtsp_transport":
  2188.  
  2189. udp Use UDP as lower transport protocol.
  2190.  
  2191. tcp Use TCP (interleaving within the RTSP control channel) as lower transport protocol.
  2192.  
  2193. udp_multicast
  2194. Use UDP multicast as lower transport protocol.
  2195.  
  2196. http
  2197. Use HTTP tunneling as lower transport protocol, which is useful for passing proxies.
  2198.  
  2199. Multiple lower transport protocols may be specified, in that case they are tried one at a time (if the setup of one fails, the next one is tried). For the muxer, only
  2200. the "tcp" and "udp" options are supported.
  2201.  
  2202. Flags for "rtsp_flags":
  2203.  
  2204. filter_src
  2205. Accept packets only from negotiated peer address and port.
  2206.  
  2207. When receiving data over UDP, the demuxer tries to reorder received packets (since they may arrive out of order, or packets may get lost totally). In order for this to be
  2208. enabled, a maximum delay must be specified in the "max_delay" field of AVFormatContext.
  2209.  
  2210. When watching multi-bitrate Real-RTSP streams with avplay, the streams to display can be chosen with "-vst" n and "-ast" n for video and audio respectively, and can be
  2211. switched on the fly by pressing "v" and "a".
  2212.  
  2213. Example command lines:
  2214.  
  2215. To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  2216.  
  2217. avplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  2218.  
  2219. To watch a stream tunneled over HTTP:
  2220.  
  2221. avplay -rtsp_transport http rtsp://server/video.mp4
  2222.  
  2223. To send a stream in realtime to a RTSP server, for others to watch:
  2224.  
  2225. avconv -re -i <input> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  2226.  
  2227. sap
  2228. Session Announcement Protocol (RFC 2974). This is not technically a protocol handler in libavformat, it is a muxer and demuxer. It is used for signalling of RTP streams,
  2229. by announcing the SDP for the streams regularly on a separate port.
  2230.  
  2231. Muxer
  2232.  
  2233. The syntax for a SAP url given to the muxer is:
  2234.  
  2235. sap://<destination>[:<port>][?<options>]
  2236.  
  2237. The RTP packets are sent to destination on port port, or to port 5004 if no port is specified. options is a "&"-separated list. The following options are supported:
  2238.  
  2239. announce_addr=address
  2240. Specify the destination IP address for sending the announcements to. If omitted, the announcements are sent to the commonly used SAP announcement multicast address
  2241. 224.2.127.254 (sap.mcast.net), or ff0e::2:7ffe if destination is an IPv6 address.
  2242.  
  2243. announce_port=port
  2244. Specify the port to send the announcements on, defaults to 9875 if not specified.
  2245.  
  2246. ttl=ttl
  2247. Specify the time to live value for the announcements and RTP packets, defaults to 255.
  2248.  
  2249. same_port=0|1
  2250. If set to 1, send all RTP streams on the same port pair. If zero (the default), all streams are sent on unique ports, with each stream on a port 2 numbers higher than
  2251. the previous. VLC/Live555 requires this to be set to 1, to be able to receive the stream. The RTP stack in libavformat for receiving requires all streams to be sent
  2252. on unique ports.
  2253.  
  2254. Example command lines follow.
  2255.  
  2256. To broadcast a stream on the local subnet, for watching in VLC:
  2257.  
  2258. avconv -re -i <input> -f sap sap://224.0.0.255?same_port=1
  2259.  
  2260. Similarly, for watching in avplay:
  2261.  
  2262. avconv -re -i <input> -f sap sap://224.0.0.255
  2263.  
  2264. And for watching in avplay, over IPv6:
  2265.  
  2266. avconv -re -i <input> -f sap sap://[ff0e::1:2:3:4]
  2267.  
  2268. Demuxer
  2269.  
  2270. The syntax for a SAP url given to the demuxer is:
  2271.  
  2272. sap://[<address>][:<port>]
  2273.  
  2274. address is the multicast address to listen for announcements on, if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port is the port that is listened on, 9875
  2275. if omitted.
  2276.  
  2277. The demuxers listens for announcements on the given address and port. Once an announcement is received, it tries to receive that particular stream.
  2278.  
  2279. Example command lines follow.
  2280.  
  2281. To play back the first stream announced on the normal SAP multicast address:
  2282.  
  2283. avplay sap://
  2284.  
  2285. To play back the first stream announced on one the default IPv6 SAP multicast address:
  2286.  
  2287. avplay sap://[ff0e::2:7ffe]
  2288.  
  2289. tcp
  2290. Trasmission Control Protocol.
  2291.  
  2292. The required syntax for a TCP url is:
  2293.  
  2294. tcp://<hostname>:<port>[?<options>]
  2295.  
  2296. listen
  2297. Listen for an incoming connection
  2298.  
  2299. avconv -i <input> -f <format> tcp://<hostname>:<port>?listen
  2300. avplay tcp://<hostname>:<port>
  2301.  
  2302. udp
  2303. User Datagram Protocol.
  2304.  
  2305. The required syntax for a UDP url is:
  2306.  
  2307. udp://<hostname>:<port>[?<options>]
  2308.  
  2309. options contains a list of &-seperated options of the form key=val. Follow the list of supported options.
  2310.  
  2311. buffer_size=size
  2312. set the UDP buffer size in bytes
  2313.  
  2314. localport=port
  2315. override the local UDP port to bind with
  2316.  
  2317. localaddr=addr
  2318. Choose the local IP address. This is useful e.g. if sending multicast and the host has multiple interfaces, where the user can choose which interface to send on by
  2319. specifying the IP address of that interface.
  2320.  
  2321. pkt_size=size
  2322. set the size in bytes of UDP packets
  2323.  
  2324. reuse=1|0
  2325. explicitly allow or disallow reusing UDP sockets
  2326.  
  2327. ttl=ttl
  2328. set the time to live value (for multicast only)
  2329.  
  2330. connect=1|0
  2331. Initialize the UDP socket with "connect()". In this case, the destination address can't be changed with ff_udp_set_remote_url later. If the destination address isn't
  2332. known at the start, this option can be specified in ff_udp_set_remote_url, too. This allows finding out the source address for the packets with getsockname, and
  2333. makes writes return with AVERROR(ECONNREFUSED) if "destination unreachable" is received. For receiving, this gives the benefit of only receiving packets from the
  2334. specified peer address/port.
  2335.  
  2336. Some usage examples of the udp protocol with avconv follow.
  2337.  
  2338. To stream over UDP to a remote endpoint:
  2339.  
  2340. avconv -i <input> -f <format> udp://<hostname>:<port>
  2341.  
  2342. To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
  2343.  
  2344. avconv -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
  2345.  
  2346. To receive over UDP from a remote endpoint:
  2347.  
  2348. avconv -i udp://[<multicast-address>]:<port>
  2349.  
  2350. BITSTREAM FILTERS
  2351. When you configure your Libav build, all the supported bitstream filters are enabled by default. You can list all available ones using the configure option "--list-bsfs".
  2352.  
  2353. You can disable all the bitstream filters using the configure option "--disable-bsfs", and selectively enable any bitstream filter using the option "--enable-bsf=BSF", or
  2354. you can disable a particular bitstream filter using the option "--disable-bsf=BSF".
  2355.  
  2356. The option "-bsfs" of the av* tools will display the list of all the supported bitstream filters included in your build.
  2357.  
  2358. Below is a description of the currently available bitstream filters.
  2359.  
  2360. aac_adtstoasc
  2361. chomp
  2362. dump_extradata
  2363. h264_mp4toannexb
  2364. imx_dump_header
  2365. mjpeg2jpeg
  2366. Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  2367.  
  2368. MJPEG is a video codec wherein each video frame is essentially a JPEG image. The individual frames can be extracted without loss, e.g. by
  2369.  
  2370. avconv -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  2371.  
  2372. Unfortunately, these chunks are incomplete JPEG images, because they lack the DHT segment required for decoding. Quoting from
  2373. <http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>:
  2374.  
  2375. Avery Lee, writing in the rec.video.desktop newsgroup in 2001, commented that "MJPEG, or at least the MJPEG in AVIs having the MJPG fourcc, is restricted JPEG with a
  2376. fixed -- and *omitted* -- Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, and it must use basic Huffman encoding, not arithmetic or progressive. . . .
  2377. You can indeed extract the MJPEG frames and decode them with a regular JPEG decoder, but you have to prepend the DHT segment to them, or else the decoder won't have any
  2378. idea how to decompress the data. The exact table necessary is given in the OpenDML spec."
  2379.  
  2380. This bitstream filter patches the header of frames extracted from an MJPEG stream (carrying the AVI1 header ID and lacking a DHT segment) to produce fully qualified JPEG
  2381. images.
  2382.  
  2383. avconv -i mjpeg-movie.avi -c:v copy -vbsf mjpeg2jpeg frame_%d.jpg
  2384. exiftran -i -9 frame*.jpg
  2385. avconv -i frame_%d.jpg -c:v copy rotated.avi
  2386.  
  2387. mjpega_dump_header
  2388. movsub
  2389. mp3_header_compress
  2390. mp3_header_decompress
  2391. noise
  2392. remove_extradata
  2393. FILTERGRAPH DESCRIPTION
  2394. A filtergraph is a directed graph of connected filters. It can contain cycles, and there can be multiple links between a pair of filters. Each link has one input pad on
  2395. one side connecting it to one filter from which it takes its input, and one output pad on the other side connecting it to the one filter accepting its output.
  2396.  
  2397. Each filter in a filtergraph is an instance of a filter class registered in the application, which defines the features and the number of input and output pads of the
  2398. filter.
  2399.  
  2400. A filter with no input pads is called a "source", a filter with no output pads is called a "sink".
  2401.  
  2402. Filtergraph syntax
  2403. A filtergraph can be represented using a textual representation, which is recognized by the "-vf" and "-af" options in avconv and avplay, and by the "av_parse_graph()"
  2404. function defined in libavfilter/avfiltergraph.
  2405.  
  2406. A filterchain consists of a sequence of connected filters, each one connected to the previous one in the sequence. A filterchain is represented by a list of ","-separated
  2407. filter descriptions.
  2408.  
  2409. A filtergraph consists of a sequence of filterchains. A sequence of filterchains is represented by a list of ";"-separated filterchain descriptions.
  2410.  
  2411. A filter is represented by a string of the form: [in_link_1]...[in_link_N]filter_name=arguments[out_link_1]...[out_link_M]
  2412.  
  2413. filter_name is the name of the filter class of which the described filter is an instance of, and has to be the name of one of the filter classes registered in the
  2414. program. The name of the filter class is optionally followed by a string "=arguments".
  2415.  
  2416. arguments is a string which contains the parameters used to initialize the filter instance, and are described in the filter descriptions below.
  2417.  
  2418. The list of arguments can be quoted using the character "'" as initial and ending mark, and the character '\' for escaping the characters within the quoted text;
  2419. otherwise the argument string is considered terminated when the next special character (belonging to the set "[]=;,") is encountered.
  2420.  
  2421. The name and arguments of the filter are optionally preceded and followed by a list of link labels. A link label allows to name a link and associate it to a filter
  2422. output or input pad. The preceding labels in_link_1 ... in_link_N, are associated to the filter input pads, the following labels out_link_1 ... out_link_M, are associated
  2423. to the output pads.
  2424.  
  2425. When two link labels with the same name are found in the filtergraph, a link between the corresponding input and output pad is created.
  2426.  
  2427. If an output pad is not labelled, it is linked by default to the first unlabelled input pad of the next filter in the filterchain. For example in the filterchain:
  2428.  
  2429. nullsrc, split[L1], [L2]overlay, nullsink
  2430.  
  2431. the split filter instance has two output pads, and the overlay filter instance two input pads. The first output pad of split is labelled "L1", the first input pad of
  2432. overlay is labelled "L2", and the second output pad of split is linked to the second input pad of overlay, which are both unlabelled.
  2433.  
  2434. In a complete filterchain all the unlabelled filter input and output pads must be connected. A filtergraph is considered valid if all the filter input and output pads of
  2435. all the filterchains are connected.
  2436.  
  2437. Follows a BNF description for the filtergraph syntax:
  2438.  
  2439. <NAME> ::= sequence of alphanumeric characters and '_'
  2440. <LINKLABEL> ::= "[" <NAME> "]"
  2441. <LINKLABELS> ::= <LINKLABEL> [<LINKLABELS>]
  2442. <FILTER_ARGUMENTS> ::= sequence of chars (eventually quoted)
  2443. <FILTER> ::= [<LINKLABELS>] <NAME> ["=" <FILTER_ARGUMENTS>] [<LINKLABELS>]
  2444. <FILTERCHAIN> ::= <FILTER> [,<FILTERCHAIN>]
  2445. <FILTERGRAPH> ::= <FILTERCHAIN> [;<FILTERGRAPH>]
  2446.  
  2447. AUDIO FILTERS
  2448. When you configure your Libav build, you can disable any of the existing filters using --disable-filters. The configure output will show the audio filters included in
  2449. your build.
  2450.  
  2451. Below is a description of the currently available audio filters.
  2452.  
  2453. anull
  2454. Pass the audio source unchanged to the output.
  2455.  
  2456. AUDIO SOURCES
  2457. Below is a description of the currently available audio sources.
  2458.  
  2459. anullsrc
  2460. Null audio source, never return audio frames. It is mainly useful as a template and to be employed in analysis / debugging tools.
  2461.  
  2462. It accepts as optional parameter a string of the form sample_rate:channel_layout.
  2463.  
  2464. sample_rate specify the sample rate, and defaults to 44100.
  2465.  
  2466. channel_layout specify the channel layout, and can be either an integer or a string representing a channel layout. The default value of channel_layout is 3, which
  2467. corresponds to CH_LAYOUT_STEREO.
  2468.  
  2469. Check the channel_layout_map definition in libavcodec/audioconvert.c for the mapping between strings and channel layout values.
  2470.  
  2471. Follow some examples:
  2472.  
  2473. # set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
  2474. anullsrc=48000:4
  2475.  
  2476. # same as
  2477. anullsrc=48000:mono
  2478.  
  2479. AUDIO SINKS
  2480. Below is a description of the currently available audio sinks.
  2481.  
  2482. anullsink
  2483. Null audio sink, do absolutely nothing with the input audio. It is mainly useful as a template and to be employed in analysis / debugging tools.
  2484.  
  2485. VIDEO FILTERS
  2486. When you configure your Libav build, you can disable any of the existing filters using --disable-filters. The configure output will show the video filters included in
  2487. your build.
  2488.  
  2489. Below is a description of the currently available video filters.
  2490.  
  2491. blackframe
  2492. Detect frames that are (almost) completely black. Can be useful to detect chapter transitions or commercials. Output lines consist of the frame number of the detected
  2493. frame, the percentage of blackness, the position in the file if known or -1 and the timestamp in seconds.
  2494.  
  2495. In order to display the output lines, you need to set the loglevel at least to the AV_LOG_INFO value.
  2496.  
  2497. The filter accepts the syntax:
  2498.  
  2499. blackframe[=<amount>:[<threshold>]]
  2500.  
  2501. amount is the percentage of the pixels that have to be below the threshold, and defaults to 98.
  2502.  
  2503. threshold is the threshold below which a pixel value is considered black, and defaults to 32.
  2504.  
  2505. boxblur
  2506. Apply boxblur algorithm to the input video.
  2507.  
  2508. This filter accepts the parameters: luma_power:luma_radius:chroma_radius:chroma_power:alpha_radius:alpha_power
  2509.  
  2510. Chroma and alpha parameters are optional, if not specified they default to the corresponding values set for luma_radius and luma_power.
  2511.  
  2512. luma_radius, chroma_radius, and alpha_radius represent the radius in pixels of the box used for blurring the corresponding input plane. They are expressions, and can
  2513. contain the following constants:
  2514.  
  2515. w, h
  2516. the input width and height in pixels
  2517.  
  2518. cw, ch
  2519. the input chroma image width and height in pixels
  2520.  
  2521. hsub, vsub
  2522. horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
  2523.  
  2524. The radius must be a non-negative number, and must not be greater than the value of the expression "min(w,h)/2" for the luma and alpha planes, and of "min(cw,ch)/2" for
  2525. the chroma planes.
  2526.  
  2527. luma_power, chroma_power, and alpha_power represent how many times the boxblur filter is applied to the corresponding plane.
  2528.  
  2529. Some examples follow:
  2530.  
  2531. · Apply a boxblur filter with luma, chroma, and alpha radius set to 2:
  2532.  
  2533. boxblur=2:1
  2534.  
  2535. · Set luma radius to 2, alpha and chroma radius to 0
  2536.  
  2537. boxblur=2:1:0:0:0:0
  2538.  
  2539. · Set luma and chroma radius to a fraction of the video dimension
  2540.  
  2541. boxblur=min(h,w)/10:1:min(cw,ch)/10:1
  2542.  
  2543. copy
  2544. Copy the input source unchanged to the output. Mainly useful for testing purposes.
  2545.  
  2546. crop
  2547. Crop the input video to out_w:out_h:x:y.
  2548.  
  2549. The parameters are expressions containing the following constants:
  2550.  
  2551. E, PI, PHI
  2552. the corresponding mathematical approximated values for e (euler number), pi (greek PI), PHI (golden ratio)
  2553.  
  2554. x, y
  2555. the computed values for x and y. They are evaluated for each new frame.
  2556.  
  2557. in_w, in_h
  2558. the input width and height
  2559.  
  2560. iw, ih
  2561. same as in_w and in_h
  2562.  
  2563. out_w, out_h
  2564. the output (cropped) width and height
  2565.  
  2566. ow, oh
  2567. same as out_w and out_h
  2568.  
  2569. n the number of input frame, starting from 0
  2570.  
  2571. pos the position in the file of the input frame, NAN if unknown
  2572.  
  2573. t timestamp expressed in seconds, NAN if the input timestamp is unknown
  2574.  
  2575. The out_w and out_h parameters specify the expressions for the width and height of the output (cropped) video. They are evaluated just at the configuration of the filter.
  2576.  
  2577. The default value of out_w is "in_w", and the default value of out_h is "in_h".
  2578.  
  2579. The expression for out_w may depend on the value of out_h, and the expression for out_h may depend on out_w, but they cannot depend on x and y, as x and y are evaluated
  2580. after out_w and out_h.
  2581.  
  2582. The x and y parameters specify the expressions for the position of the top-left corner of the output (non-cropped) area. They are evaluated for each frame. If the
  2583. evaluated value is not valid, it is approximated to the nearest valid value.
  2584.  
  2585. The default value of x is "(in_w-out_w)/2", and the default value for y is "(in_h-out_h)/2", which set the cropped area at the center of the input image.
  2586.  
  2587. The expression for x may depend on y, and the expression for y may depend on x.
  2588.  
  2589. Follow some examples:
  2590.  
  2591. # crop the central input area with size 100x100
  2592. crop=100:100
  2593.  
  2594. # crop the central input area with size 2/3 of the input video
  2595. "crop=2/3*in_w:2/3*in_h"
  2596.  
  2597. # crop the input video central square
  2598. crop=in_h
  2599.  
  2600. # delimit the rectangle with the top-left corner placed at position
  2601. # 100:100 and the right-bottom corner corresponding to the right-bottom
  2602. # corner of the input image.
  2603. crop=in_w-100:in_h-100:100:100
  2604.  
  2605. # crop 10 pixels from the left and right borders, and 20 pixels from
  2606. # the top and bottom borders
  2607. "crop=in_w-2*10:in_h-2*20"
  2608.  
  2609. # keep only the bottom right quarter of the input image
  2610. "crop=in_w/2:in_h/2:in_w/2:in_h/2"
  2611.  
  2612. # crop height for getting Greek harmony
  2613. "crop=in_w:1/PHI*in_w"
  2614.  
  2615. # trembling effect
  2616. "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"
  2617.  
  2618. # erratic camera effect depending on timestamp
  2619. "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
  2620.  
  2621. # set x depending on the value of y
  2622. "crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
  2623.  
  2624. cropdetect
  2625. Auto-detect crop size.
  2626.  
  2627. Calculate necessary cropping parameters and prints the recommended parameters through the logging system. The detected dimensions correspond to the non-black area of the
  2628. input video.
  2629.  
  2630. It accepts the syntax:
  2631.  
  2632. cropdetect[=<limit>[:<round>[:<reset>]]]
  2633.  
  2634. limit
  2635. Threshold, which can be optionally specified from nothing (0) to everything (255), defaults to 24.
  2636.  
  2637. round
  2638. Value which the width/height should be divisible by, defaults to 16. The offset is automatically adjusted to center the video. Use 2 to get only even dimensions
  2639. (needed for 4:2:2 video). 16 is best when encoding to most video codecs.
  2640.  
  2641. reset
  2642. Counter that determines after how many frames cropdetect will reset the previously detected largest video area and start over to detect the current optimal crop area.
  2643. Defaults to 0.
  2644.  
  2645. This can be useful when channel logos distort the video area. 0 indicates never reset and return the largest area encountered during playback.
  2646.  
  2647. delogo
  2648. Suppress a TV station logo by a simple interpolation of the surrounding pixels. Just set a rectangle covering the logo and watch it disappear (and sometimes something
  2649. even uglier appear - your mileage may vary).
  2650.  
  2651. The filter accepts parameters as a string of the form "x:y:w:h:band", or as a list of key=value pairs, separated by ":".
  2652.  
  2653. The description of the accepted parameters follows.
  2654.  
  2655. x, y
  2656. Specify the top left corner coordinates of the logo. They must be specified.
  2657.  
  2658. w, h
  2659. Specify the width and height of the logo to clear. They must be specified.
  2660.  
  2661. band, t
  2662. Specify the thickness of the fuzzy edge of the rectangle (added to w and h). The default value is 4.
  2663.  
  2664. show
  2665. When set to 1, a green rectangle is drawn on the screen to simplify finding the right x, y, w, h parameters, and band is set to 4. The default value is 0.
  2666.  
  2667. Some examples follow.
  2668.  
  2669. · Set a rectangle covering the area with top left corner coordinates 0,0 and size 100x77, setting a band of size 10:
  2670.  
  2671. delogo=0:0:100:77:10
  2672.  
  2673. · As the previous example, but use named options:
  2674.  
  2675. delogo=x=0:y=0:w=100:h=77:band=10
  2676.  
  2677. drawbox
  2678. Draw a colored box on the input image.
  2679.  
  2680. It accepts the syntax:
  2681.  
  2682. drawbox=<x>:<y>:<width>:<height>:<color>
  2683.  
  2684. x, y
  2685. Specify the top left corner coordinates of the box. Default to 0.
  2686.  
  2687. width, height
  2688. Specify the width and height of the box, if 0 they are interpreted as the input width and height. Default to 0.
  2689.  
  2690. color
  2691. Specify the color of the box to write, it can be the name of a color (case insensitive match) or a 0xRRGGBB[AA] sequence.
  2692.  
  2693. Follow some examples:
  2694.  
  2695. # draw a black box around the edge of the input image
  2696. drawbox
  2697.  
  2698. # draw a box with color red and an opacity of 50%
  2699. drawbox=10:20:200:60:[email protected]"
  2700.  
  2701. drawtext
  2702. Draw text string or text from specified file on top of video using the libfreetype library.
  2703.  
  2704. To enable compilation of this filter you need to configure Libav with "--enable-libfreetype".
  2705.  
  2706. The filter also recognizes strftime() sequences in the provided text and expands them accordingly. Check the documentation of strftime().
  2707.  
  2708. The filter accepts parameters as a list of key=value pairs, separated by ":".
  2709.  
  2710. The description of the accepted parameters follows.
  2711.  
  2712. fontfile
  2713. The font file to be used for drawing text. Path must be included. This parameter is mandatory.
  2714.  
  2715. text
  2716. The text string to be drawn. The text must be a sequence of UTF-8 encoded characters. This parameter is mandatory if no file is specified with the parameter
  2717. textfile.
  2718.  
  2719. textfile
  2720. A text file containing text to be drawn. The text must be a sequence of UTF-8 encoded characters.
  2721.  
  2722. This parameter is mandatory if no text string is specified with the parameter text.
  2723.  
  2724. If both text and textfile are specified, an error is thrown.
  2725.  
  2726. x, y
  2727. The offsets where text will be drawn within the video frame. Relative to the top/left border of the output image. They accept expressions similar to the overlay
  2728. filter:
  2729.  
  2730. x, y
  2731. the computed values for x and y. They are evaluated for each new frame.
  2732.  
  2733. main_w, main_h
  2734. main input width and height
  2735.  
  2736. W, H
  2737. same as main_w and main_h
  2738.  
  2739. text_w, text_h
  2740. rendered text width and height
  2741.  
  2742. w, h
  2743. same as text_w and text_h
  2744.  
  2745. n the number of frames processed, starting from 0
  2746.  
  2747. t timestamp expressed in seconds, NAN if the input timestamp is unknown
  2748.  
  2749. The default value of x and y is 0.
  2750.  
  2751. fontsize
  2752. The font size to be used for drawing text. The default value of fontsize is 16.
  2753.  
  2754. fontcolor
  2755. The color to be used for drawing fonts. Either a string (e.g. "red") or in 0xRRGGBB[AA] format (e.g. "0xff000033"), possibly followed by an alpha specifier. The
  2756. default value of fontcolor is "black".
  2757.  
  2758. boxcolor
  2759. The color to be used for drawing box around text. Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format (e.g. "0xff00ff"), possibly followed by an alpha
  2760. specifier. The default value of boxcolor is "white".
  2761.  
  2762. box Used to draw a box around text using background color. Value should be either 1 (enable) or 0 (disable). The default value of box is 0.
  2763.  
  2764. shadowx, shadowy
  2765. The x and y offsets for the text shadow position with respect to the position of the text. They can be either positive or negative values. Default value for both is
  2766. "0".
  2767.  
  2768. shadowcolor
  2769. The color to be used for drawing a shadow behind the drawn text. It can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA] form (e.g. "0xff00ff"),
  2770. possibly followed by an alpha specifier. The default value of shadowcolor is "black".
  2771.  
  2772. ft_load_flags
  2773. Flags to be used for loading the fonts.
  2774.  
  2775. The flags map the corresponding flags supported by libfreetype, and are a combination of the following values:
  2776.  
  2777. default
  2778. no_scale
  2779. no_hinting
  2780. render
  2781. no_bitmap
  2782. vertical_layout
  2783. force_autohint
  2784. crop_bitmap
  2785. pedantic
  2786. ignore_global_advance_width
  2787. no_recurse
  2788. ignore_transform
  2789. monochrome
  2790. linear_design
  2791. no_autohint
  2792. end table
  2793.  
  2794. Default value is "render".
  2795.  
  2796. For more information consult the documentation for the FT_LOAD_* libfreetype flags.
  2797.  
  2798. tabsize
  2799. The size in number of spaces to use for rendering the tab. Default value is 4.
  2800.  
  2801. For example the command:
  2802.  
  2803. drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
  2804.  
  2805. will draw "Test Text" with font FreeSerif, using the default values for the optional parameters.
  2806.  
  2807. The command:
  2808.  
  2809. drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  2810. x=100: y=50: fontsize=24: [email protected]: box=1: [email protected]"
  2811.  
  2812. will draw 'Test Text' with font FreeSerif of size 24 at position x=100 and y=50 (counting from the top-left corner of the screen), text is yellow with a red box around
  2813. it. Both the text and the box have an opacity of 20%.
  2814.  
  2815. Note that the double quotes are not necessary if spaces are not used within the parameter list.
  2816.  
  2817. For more information about libfreetype, check: <http://www.freetype.org/>.
  2818.  
  2819. fade
  2820. Apply fade-in/out effect to input video.
  2821.  
  2822. It accepts the parameters: type:start_frame:nb_frames
  2823.  
  2824. type specifies if the effect type, can be either "in" for fade-in, or "out" for a fade-out effect.
  2825.  
  2826. start_frame specifies the number of the start frame for starting to apply the fade effect.
  2827.  
  2828. nb_frames specifies the number of frames for which the fade effect has to last. At the end of the fade-in effect the output video will have the same intensity as the
  2829. input video, at the end of the fade-out transition the output video will be completely black.
  2830.  
  2831. A few usage examples follow, usable too as test scenarios.
  2832.  
  2833. # fade in first 30 frames of video
  2834. fade=in:0:30
  2835.  
  2836. # fade out last 45 frames of a 200-frame video
  2837. fade=out:155:45
  2838.  
  2839. # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
  2840. fade=in:0:25, fade=out:975:25
  2841.  
  2842. # make first 5 frames black, then fade in from frame 5-24
  2843. fade=in:5:20
  2844.  
  2845. fieldorder
  2846. Transform the field order of the input video.
  2847.  
  2848. It accepts one parameter which specifies the required field order that the input interlaced video will be transformed to. The parameter can assume one of the following
  2849. values:
  2850.  
  2851. 0 or bff
  2852. output bottom field first
  2853.  
  2854. 1 or tff
  2855. output top field first
  2856.  
  2857. Default value is "tff".
  2858.  
  2859. Transformation is achieved by shifting the picture content up or down by one line, and filling the remaining line with appropriate picture content. This method is
  2860. consistent with most broadcast field order converters.
  2861.  
  2862. If the input video is not flagged as being interlaced, or it is already flagged as being of the required output field order then this filter does not alter the incoming
  2863. video.
  2864.  
  2865. This filter is very useful when converting to or from PAL DV material, which is bottom field first.
  2866.  
  2867. For example:
  2868.  
  2869. ./avconv -i in.vob -vf "fieldorder=bff" out.dv
  2870.  
  2871. fifo
  2872. Buffer input images and send them when they are requested.
  2873.  
  2874. This filter is mainly useful when auto-inserted by the libavfilter framework.
  2875.  
  2876. The filter does not take parameters.
  2877.  
  2878. format
  2879. Convert the input video to one of the specified pixel formats. Libavfilter will try to pick one that is supported for the input to the next filter.
  2880.  
  2881. The filter accepts a list of pixel format names, separated by ":", for example "yuv420p:monow:rgb24".
  2882.  
  2883. Some examples follow:
  2884.  
  2885. # convert the input video to the format "yuv420p"
  2886. format=yuv420p
  2887.  
  2888. # convert the input video to any of the formats in the list
  2889. format=yuv420p:yuv444p:yuv410p
  2890.  
  2891. frei0r
  2892. Apply a frei0r effect to the input video.
  2893.  
  2894. To enable compilation of this filter you need to install the frei0r header and configure Libav with --enable-frei0r.
  2895.  
  2896. The filter supports the syntax:
  2897.  
  2898. <filter_name>[{:|=}<param1>:<param2>:...:<paramN>]
  2899.  
  2900. filter_name is the name to the frei0r effect to load. If the environment variable FREI0R_PATH is defined, the frei0r effect is searched in each one of the directories
  2901. specified by the colon separated list in FREIOR_PATH, otherwise in the standard frei0r paths, which are in this order: HOME/.frei0r-1/lib/, /usr/local/lib/frei0r-1/,
  2902. /usr/lib/frei0r-1/.
  2903.  
  2904. param1, param2, ... , paramN specify the parameters for the frei0r effect.
  2905.  
  2906. A frei0r effect parameter can be a boolean (whose values are specified with "y" and "n"), a double, a color (specified by the syntax R/G/B, R, G, and B being float
  2907. numbers from 0.0 to 1.0) or by an "av_parse_color()" color description), a position (specified by the syntax X/Y, X and Y being float numbers) and a string.
  2908.  
  2909. The number and kind of parameters depend on the loaded effect. If an effect parameter is not specified the default value is set.
  2910.  
  2911. Some examples follow:
  2912.  
  2913. # apply the distort0r effect, set the first two double parameters
  2914. frei0r=distort0r:0.5:0.01
  2915.  
  2916. # apply the colordistance effect, takes a color as first parameter
  2917. frei0r=colordistance:0.2/0.3/0.4
  2918. frei0r=colordistance:violet
  2919. frei0r=colordistance:0x112233
  2920.  
  2921. # apply the perspective effect, specify the top left and top right
  2922. # image positions
  2923. frei0r=perspective:0.2/0.2:0.8/0.2
  2924.  
  2925. For more information see: <http://piksel.org/frei0r>
  2926.  
  2927. gradfun
  2928. Fix the banding artifacts that are sometimes introduced into nearly flat regions by truncation to 8bit colordepth. Interpolate the gradients that should go where the
  2929. bands are, and dither them.
  2930.  
  2931. This filter is designed for playback only. Do not use it prior to lossy compression, because compression tends to lose the dither and bring back the bands.
  2932.  
  2933. The filter takes two optional parameters, separated by ':': strength:radius
  2934.  
  2935. strength is the maximum amount by which the filter will change any one pixel. Also the threshold for detecting nearly flat regions. Acceptable values range from .51 to
  2936. 255, default value is 1.2, out-of-range values will be clipped to the valid range.
  2937.  
  2938. radius is the neighborhood to fit the gradient to. A larger radius makes for smoother gradients, but also prevents the filter from modifying the pixels near detailed
  2939. regions. Acceptable values are 8-32, default value is 16, out-of-range values will be clipped to the valid range.
  2940.  
  2941. # default parameters
  2942. gradfun=1.2:16
  2943.  
  2944. # omitting radius
  2945. gradfun=1.2
  2946.  
  2947. hflip
  2948. Flip the input video horizontally.
  2949.  
  2950. For example to horizontally flip the input video with avconv:
  2951.  
  2952. avconv -i in.avi -vf "hflip" out.avi
  2953.  
  2954. hqdn3d
  2955. High precision/quality 3d denoise filter. This filter aims to reduce image noise producing smooth images and making still images really still. It should enhance
  2956. compressibility.
  2957.  
  2958. It accepts the following optional parameters: luma_spatial:chroma_spatial:luma_tmp:chroma_tmp
  2959.  
  2960. luma_spatial
  2961. a non-negative float number which specifies spatial luma strength, defaults to 4.0
  2962.  
  2963. chroma_spatial
  2964. a non-negative float number which specifies spatial chroma strength, defaults to 3.0*luma_spatial/4.0
  2965.  
  2966. luma_tmp
  2967. a float number which specifies luma temporal strength, defaults to 6.0*luma_spatial/4.0
  2968.  
  2969. chroma_tmp
  2970. a float number which specifies chroma temporal strength, defaults to luma_tmp*chroma_spatial/luma_spatial
  2971.  
  2972. lut, lutrgb, lutyuv
  2973. Compute a look-up table for binding each pixel component input value to an output value, and apply it to input video.
  2974.  
  2975. lutyuv applies a lookup table to a YUV input video, lutrgb to an RGB input video.
  2976.  
  2977. These filters accept in input a ":"-separated list of options, which specify the expressions used for computing the lookup table for the corresponding pixel component
  2978. values.
  2979.  
  2980. The lut filter requires either YUV or RGB pixel formats in input, and accepts the options:
  2981.  
  2982. c0 (first pixel component) c1 (second pixel component) c2 (third pixel component) c3 (fourth pixel component, corresponds to the alpha component)
  2983.  
  2984. The exact component associated to each option depends on the format in input.
  2985.  
  2986. The lutrgb filter requires RGB pixel formats in input, and accepts the options:
  2987.  
  2988. r (red component) g (green component) b (blue component) a (alpha component)
  2989.  
  2990. The lutyuv filter requires YUV pixel formats in input, and accepts the options:
  2991.  
  2992. y (Y/luminance component) u (U/Cb component) v (V/Cr component) a (alpha component)
  2993.  
  2994. The expressions can contain the following constants and functions:
  2995.  
  2996. E, PI, PHI
  2997. the corresponding mathematical approximated values for e (euler number), pi (greek PI), PHI (golden ratio)
  2998.  
  2999. w, h
  3000. the input width and height
  3001.  
  3002. val input value for the pixel component
  3003.  
  3004. clipval
  3005. the input value clipped in the minval-maxval range
  3006.  
  3007. maxval
  3008. maximum value for the pixel component
  3009.  
  3010. minval
  3011. minimum value for the pixel component
  3012.  
  3013. negval
  3014. the negated value for the pixel component value clipped in the minval-maxval range , it corresponds to the expression "maxval-clipval+minval"
  3015.  
  3016. clip(val)
  3017. the computed value in val clipped in the minval-maxval range
  3018.  
  3019. gammaval(gamma)
  3020. the computed gamma correction value of the pixel component value clipped in the minval-maxval range, corresponds to the expression
  3021. "pow((clipval-minval)/(maxval-minval),gamma)*(maxval-minval)+minval"
  3022.  
  3023. All expressions default to "val".
  3024.  
  3025. Some examples follow:
  3026.  
  3027. # negate input video
  3028. lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
  3029. lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
  3030.  
  3031. # the above is the same as
  3032. lutrgb="r=negval:g=negval:b=negval"
  3033. lutyuv="y=negval:u=negval:v=negval"
  3034.  
  3035. # negate luminance
  3036. lutyuv=negval
  3037.  
  3038. # remove chroma components, turns the video into a graytone image
  3039. lutyuv="u=128:v=128"
  3040.  
  3041. # apply a luma burning effect
  3042. lutyuv="y=2*val"
  3043.  
  3044. # remove green and blue components
  3045. lutrgb="g=0:b=0"
  3046.  
  3047. # set a constant alpha channel value on input
  3048. format=rgba,lutrgb=a="maxval-minval/2"
  3049.  
  3050. # correct luminance gamma by a 0.5 factor
  3051. lutyuv=y=gammaval(0.5)
  3052.  
  3053. negate
  3054. Negate input video.
  3055.  
  3056. This filter accepts an integer in input, if non-zero it negates the alpha component (if available). The default value in input is 0.
  3057.  
  3058. Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
  3059.  
  3060. The filter accepts a list of pixel format names, separated by ":", for example "yuv420p:monow:rgb24".
  3061.  
  3062. Some examples follow:
  3063.  
  3064. # force libavfilter to use a format different from "yuv420p" for the
  3065. # input to the vflip filter
  3066. noformat=yuv420p,vflip
  3067.  
  3068. # convert the input video to any of the formats not contained in the list
  3069. noformat=yuv420p:yuv444p:yuv410p
  3070.  
  3071. null
  3072. Pass the video source unchanged to the output.
  3073.  
  3074. ocv
  3075. Apply video transform using libopencv.
  3076.  
  3077. To enable this filter install libopencv library and headers and configure Libav with --enable-libopencv.
  3078.  
  3079. The filter takes the parameters: filter_name{:=}filter_params.
  3080.  
  3081. filter_name is the name of the libopencv filter to apply.
  3082.  
  3083. filter_params specifies the parameters to pass to the libopencv filter. If not specified the default values are assumed.
  3084.  
  3085. Refer to the official libopencv documentation for more precise information: <http://opencv.willowgarage.com/documentation/c/image_filtering.html>
  3086.  
  3087. Follows the list of supported libopencv filters.
  3088.  
  3089. dilate
  3090.  
  3091. Dilate an image by using a specific structuring element. This filter corresponds to the libopencv function "cvDilate".
  3092.  
  3093. It accepts the parameters: struct_el:nb_iterations.
  3094.  
  3095. struct_el represents a structuring element, and has the syntax: colsxrows+anchor_xxanchor_y/shape
  3096.  
  3097. cols and rows represent the number of columns and rows of the structuring element, anchor_x and anchor_y the anchor point, and shape the shape for the structuring
  3098. element, and can be one of the values "rect", "cross", "ellipse", "custom".
  3099.  
  3100. If the value for shape is "custom", it must be followed by a string of the form "=filename". The file with name filename is assumed to represent a binary image, with each
  3101. printable character corresponding to a bright pixel. When a custom shape is used, cols and rows are ignored, the number or columns and rows of the read file are assumed
  3102. instead.
  3103.  
  3104. The default value for struct_el is "3x3+0x0/rect".
  3105.  
  3106. nb_iterations specifies the number of times the transform is applied to the image, and defaults to 1.
  3107.  
  3108. Follow some example:
  3109.  
  3110. # use the default values
  3111. ocv=dilate
  3112.  
  3113. # dilate using a structuring element with a 5x5 cross, iterate two times
  3114. ocv=dilate=5x5+2x2/cross:2
  3115.  
  3116. # read the shape from the file diamond.shape, iterate two times
  3117. # the file diamond.shape may contain a pattern of characters like this:
  3118. # *
  3119. # ***
  3120. # *****
  3121. # ***
  3122. # *
  3123. # the specified cols and rows are ignored (but not the anchor point coordinates)
  3124. ocv=0x0+2x2/custom=diamond.shape:2
  3125.  
  3126. erode
  3127.  
  3128. Erode an image by using a specific structuring element. This filter corresponds to the libopencv function "cvErode".
  3129.  
  3130. The filter accepts the parameters: struct_el:nb_iterations, with the same syntax and semantics as the dilate filter.
  3131.  
  3132. smooth
  3133.  
  3134. Smooth the input video.
  3135.  
  3136. The filter takes the following parameters: type:param1:param2:param3:param4.
  3137.  
  3138. type is the type of smooth filter to apply, and can be one of the following values: "blur", "blur_no_scale", "median", "gaussian", "bilateral". The default value is
  3139. "gaussian".
  3140.  
  3141. param1, param2, param3, and param4 are parameters whose meanings depend on smooth type. param1 and param2 accept integer positive values or 0, param3 and param4 accept
  3142. float values.
  3143.  
  3144. The default value for param1 is 3, the default value for the other parameters is 0.
  3145.  
  3146. These parameters correspond to the parameters assigned to the libopencv function "cvSmooth".
  3147.  
  3148. overlay
  3149. Overlay one video on top of another.
  3150.  
  3151. It takes two inputs and one output, the first input is the "main" video on which the second input is overlayed.
  3152.  
  3153. It accepts the parameters: x:y.
  3154.  
  3155. x is the x coordinate of the overlayed video on the main video, y is the y coordinate. The parameters are expressions containing the following parameters:
  3156.  
  3157. main_w, main_h
  3158. main input width and height
  3159.  
  3160. W, H
  3161. same as main_w and main_h
  3162.  
  3163. overlay_w, overlay_h
  3164. overlay input width and height
  3165.  
  3166. w, h
  3167. same as overlay_w and overlay_h
  3168.  
  3169. Be aware that frames are taken from each input video in timestamp order, hence, if their initial timestamps differ, it is a a good idea to pass the two inputs through a
  3170. setpts=PTS-STARTPTS filter to have them begin in the same zero timestamp, as it does the example for the movie filter.
  3171.  
  3172. Follow some examples:
  3173.  
  3174. # draw the overlay at 10 pixels from the bottom right
  3175. # corner of the main video.
  3176. overlay=main_w-overlay_w-10:main_h-overlay_h-10
  3177.  
  3178. # insert a transparent PNG logo in the bottom left corner of the input
  3179. movie=logo.png [logo];
  3180. [in][logo] overlay=10:main_h-overlay_h-10 [out]
  3181.  
  3182. # insert 2 different transparent PNG logos (second logo on bottom
  3183. # right corner):
  3184. movie=logo1.png [logo1];
  3185. movie=logo2.png [logo2];
  3186. [in][logo1] overlay=10:H-h-10 [in+logo1];
  3187. [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
  3188.  
  3189. # add a transparent color layer on top of the main video,
  3190. # WxH specifies the size of the main input to the overlay filter
  3191. color=red.3:WxH [over]; [in][over] overlay [out]
  3192.  
  3193. You can chain together more overlays but the efficiency of such approach is yet to be tested.
  3194.  
  3195. pad
  3196. Add paddings to the input image, and places the original input at the given coordinates x, y.
  3197.  
  3198. It accepts the following parameters: width:height:x:y:color.
  3199.  
  3200. The parameters width, height, x, and y are expressions containing the following constants:
  3201.  
  3202. E, PI, PHI
  3203. the corresponding mathematical approximated values for e (euler number), pi (greek PI), phi (golden ratio)
  3204.  
  3205. in_w, in_h
  3206. the input video width and height
  3207.  
  3208. iw, ih
  3209. same as in_w and in_h
  3210.  
  3211. out_w, out_h
  3212. the output width and height, that is the size of the padded area as specified by the width and height expressions
  3213.  
  3214. ow, oh
  3215. same as out_w and out_h
  3216.  
  3217. x, y
  3218. x and y offsets as specified by the x and y expressions, or NAN if not yet specified
  3219.  
  3220. a input display aspect ratio, same as iw / ih
  3221.  
  3222. hsub, vsub
  3223. horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
  3224.  
  3225. Follows the description of the accepted parameters.
  3226.  
  3227. width, height
  3228. Specify the size of the output image with the paddings added. If the value for width or height is 0, the corresponding input size is used for the output.
  3229.  
  3230. The width expression can reference the value set by the height expression, and vice versa.
  3231.  
  3232. The default value of width and height is 0.
  3233.  
  3234. x, y
  3235. Specify the offsets where to place the input image in the padded area with respect to the top/left border of the output image.
  3236.  
  3237. The x expression can reference the value set by the y expression, and vice versa.
  3238.  
  3239. The default value of x and y is 0.
  3240.  
  3241. color
  3242. Specify the color of the padded area, it can be the name of a color (case insensitive match) or a 0xRRGGBB[AA] sequence.
  3243.  
  3244. The default value of color is "black".
  3245.  
  3246. Some examples follow:
  3247.  
  3248. # Add paddings with color "violet" to the input video. Output video
  3249. # size is 640x480, the top-left corner of the input video is placed at
  3250. # column 0, row 40.
  3251. pad=640:480:0:40:violet
  3252.  
  3253. # pad the input to get an output with dimensions increased bt 3/2,
  3254. # and put the input video at the center of the padded area
  3255. pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
  3256.  
  3257. # pad the input to get a squared output with size equal to the maximum
  3258. # value between the input width and height, and put the input video at
  3259. # the center of the padded area
  3260. pad="max(iw,ih):ow:(ow-iw)/2:(oh-ih)/2"
  3261.  
  3262. # pad the input to get a final w/h ratio of 16:9
  3263. pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
  3264.  
  3265. # double output size and put the input video in the bottom-right
  3266. # corner of the output padded area
  3267. pad="2*iw:2*ih:ow-iw:oh-ih"
  3268.  
  3269. pixdesctest
  3270. Pixel format descriptor test filter, mainly useful for internal testing. The output video should be equal to the input video.
  3271.  
  3272. For example:
  3273.  
  3274. format=monow, pixdesctest
  3275.  
  3276. can be used to test the monowhite pixel format descriptor definition.
  3277.  
  3278. scale
  3279. Scale the input video to width:height and/or convert the image format.
  3280.  
  3281. The parameters width and height are expressions containing the following constants:
  3282.  
  3283. E, PI, PHI
  3284. the corresponding mathematical approximated values for e (euler number), pi (greek PI), phi (golden ratio)
  3285.  
  3286. in_w, in_h
  3287. the input width and height
  3288.  
  3289. iw, ih
  3290. same as in_w and in_h
  3291.  
  3292. out_w, out_h
  3293. the output (cropped) width and height
  3294.  
  3295. ow, oh
  3296. same as out_w and out_h
  3297.  
  3298. dar, a
  3299. input display aspect ratio, same as iw / ih
  3300.  
  3301. sar input sample aspect ratio
  3302.  
  3303. hsub, vsub
  3304. horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.
  3305.  
  3306. If the input image format is different from the format requested by the next filter, the scale filter will convert the input to the requested format.
  3307.  
  3308. If the value for width or height is 0, the respective input size is used for the output.
  3309.  
  3310. If the value for width or height is -1, the scale filter will use, for the respective output size, a value that maintains the aspect ratio of the input image.
  3311.  
  3312. The default value of width and height is 0.
  3313.  
  3314. Some examples follow:
  3315.  
  3316. # scale the input video to a size of 200x100.
  3317. scale=200:100
  3318.  
  3319. # scale the input to 2x
  3320. scale=2*iw:2*ih
  3321. # the above is the same as
  3322. scale=2*in_w:2*in_h
  3323.  
  3324. # scale the input to half size
  3325. scale=iw/2:ih/2
  3326.  
  3327. # increase the width, and set the height to the same size
  3328. scale=3/2*iw:ow
  3329.  
  3330. # seek for Greek harmony
  3331. scale=iw:1/PHI*iw
  3332. scale=ih*PHI:ih
  3333.  
  3334. # increase the height, and set the width to 3/2 of the height
  3335. scale=3/2*oh:3/5*ih
  3336.  
  3337. # increase the size, but make the size a multiple of the chroma
  3338. scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
  3339.  
  3340. # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
  3341. scale='min(500, iw*3/2):-1'
  3342.  
  3343. select
  3344. Select frames to pass in output.
  3345.  
  3346. It accepts in input an expression, which is evaluated for each input frame. If the expression is evaluated to a non-zero value, the frame is selected and passed to the
  3347. output, otherwise it is discarded.
  3348.  
  3349. The expression can contain the following constants:
  3350.  
  3351. PI Greek PI
  3352.  
  3353. PHI golden ratio
  3354.  
  3355. E Euler number
  3356.  
  3357. n the sequential number of the filtered frame, starting from 0
  3358.  
  3359. selected_n
  3360. the sequential number of the selected frame, starting from 0
  3361.  
  3362. prev_selected_n
  3363. the sequential number of the last selected frame, NAN if undefined
  3364.  
  3365. TB timebase of the input timestamps
  3366.  
  3367. pts the PTS (Presentation TimeStamp) of the filtered video frame, expressed in TB units, NAN if undefined
  3368.  
  3369. t the PTS (Presentation TimeStamp) of the filtered video frame, expressed in seconds, NAN if undefined
  3370.  
  3371. prev_pts
  3372. the PTS of the previously filtered video frame, NAN if undefined
  3373.  
  3374. prev_selected_pts
  3375. the PTS of the last previously filtered video frame, NAN if undefined
  3376.  
  3377. prev_selected_t
  3378. the PTS of the last previously selected video frame, NAN if undefined
  3379.  
  3380. start_pts
  3381. the PTS of the first video frame in the video, NAN if undefined
  3382.  
  3383. start_t
  3384. the time of the first video frame in the video, NAN if undefined
  3385.  
  3386. pict_type
  3387. the type of the filtered frame, can assume one of the following values:
  3388.  
  3389. I
  3390. P
  3391. B
  3392. S
  3393. SI
  3394. SP
  3395. BI
  3396. interlace_type
  3397. the frame interlace type, can assume one of the following values:
  3398.  
  3399. PROGRESSIVE
  3400. the frame is progressive (not interlaced)
  3401.  
  3402. TOPFIRST
  3403. the frame is top-field-first
  3404.  
  3405. BOTTOMFIRST
  3406. the frame is bottom-field-first
  3407.  
  3408. key 1 if the filtered frame is a key-frame, 0 otherwise
  3409.  
  3410. pos the position in the file of the filtered frame, -1 if the information is not available (e.g. for synthetic video)
  3411.  
  3412. The default value of the select expression is "1".
  3413.  
  3414. Some examples follow:
  3415.  
  3416. # select all frames in input
  3417. select
  3418.  
  3419. # the above is the same as:
  3420. select=1
  3421.  
  3422. # skip all frames:
  3423. select=0
  3424.  
  3425. # select only I-frames
  3426. select='eq(pict_type,I)'
  3427.  
  3428. # select one frame every 100
  3429. select='not(mod(n,100))'
  3430.  
  3431. # select only frames contained in the 10-20 time interval
  3432. select='gte(t,10)*lte(t,20)'
  3433.  
  3434. # select only I frames contained in the 10-20 time interval
  3435. select='gte(t,10)*lte(t,20)*eq(pict_type,I)'
  3436.  
  3437. # select frames with a minimum distance of 10 seconds
  3438. select='isnan(prev_selected_t)+gte(t-prev_selected_t,10)'
  3439.  
  3440. setdar
  3441. Set the Display Aspect Ratio for the filter output video.
  3442.  
  3443. This is done by changing the specified Sample (aka Pixel) Aspect Ratio, according to the following equation: DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR
  3444.  
  3445. Keep in mind that this filter does not modify the pixel dimensions of the video frame. Also the display aspect ratio set by this filter may be changed by later filters in
  3446. the filterchain, e.g. in case of scaling or if another "setdar" or a "setsar" filter is applied.
  3447.  
  3448. The filter accepts a parameter string which represents the wanted display aspect ratio. The parameter can be a floating point number string, or an expression of the form
  3449. num:den, where num and den are the numerator and denominator of the aspect ratio. If the parameter is not specified, it is assumed the value "0:1".
  3450.  
  3451. For example to change the display aspect ratio to 16:9, specify:
  3452.  
  3453. setdar=16:9
  3454. # the above is equivalent to
  3455. setdar=1.77777
  3456.  
  3457. See also the setsar filter documentation.
  3458.  
  3459. setpts
  3460. Change the PTS (presentation timestamp) of the input video frames.
  3461.  
  3462. Accept in input an expression evaluated through the eval API, which can contain the following constants:
  3463.  
  3464. PTS the presentation timestamp in input
  3465.  
  3466. PI Greek PI
  3467.  
  3468. PHI golden ratio
  3469.  
  3470. E Euler number
  3471.  
  3472. N the count of the input frame, starting from 0.
  3473.  
  3474. STARTPTS
  3475. the PTS of the first video frame
  3476.  
  3477. INTERLACED
  3478. tell if the current frame is interlaced
  3479.  
  3480. POS original position in the file of the frame, or undefined if undefined for the current frame
  3481.  
  3482. PREV_INPTS
  3483. previous input PTS
  3484.  
  3485. PREV_OUTPTS
  3486. previous output PTS
  3487.  
  3488. Some examples follow:
  3489.  
  3490. # start counting PTS from zero
  3491. setpts=PTS-STARTPTS
  3492.  
  3493. # fast motion
  3494. setpts=0.5*PTS
  3495.  
  3496. # slow motion
  3497. setpts=2.0*PTS
  3498.  
  3499. # fixed rate 25 fps
  3500. setpts=N/(25*TB)
  3501.  
  3502. # fixed rate 25 fps with some jitter
  3503. setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  3504.  
  3505. setsar
  3506. Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
  3507.  
  3508. Note that as a consequence of the application of this filter, the output display aspect ratio will change according to the following equation: DAR = HORIZONTAL_RESOLUTION
  3509. / VERTICAL_RESOLUTION * SAR
  3510.  
  3511. Keep in mind that the sample aspect ratio set by this filter may be changed by later filters in the filterchain, e.g. if another "setsar" or a "setdar" filter is applied.
  3512.  
  3513. The filter accepts a parameter string which represents the wanted sample aspect ratio. The parameter can be a floating point number string, or an expression of the form
  3514. num:den, where num and den are the numerator and denominator of the aspect ratio. If the parameter is not specified, it is assumed the value "0:1".
  3515.  
  3516. For example to change the sample aspect ratio to 10:11, specify:
  3517.  
  3518. setsar=10:11
  3519.  
  3520. settb
  3521. Set the timebase to use for the output frames timestamps. It is mainly useful for testing timebase configuration.
  3522.  
  3523. It accepts in input an arithmetic expression representing a rational. The expression can contain the constants "PI", "E", "PHI", "AVTB" (the default timebase), and
  3524. "intb" (the input timebase).
  3525.  
  3526. The default value for the input is "intb".
  3527.  
  3528. Follow some examples.
  3529.  
  3530. # set the timebase to 1/25
  3531. settb=1/25
  3532.  
  3533. # set the timebase to 1/10
  3534. settb=0.1
  3535.  
  3536. #set the timebase to 1001/1000
  3537. settb=1+0.001
  3538.  
  3539. #set the timebase to 2*intb
  3540. settb=2*intb
  3541.  
  3542. #set the default timebase value
  3543. settb=AVTB
  3544.  
  3545. showinfo
  3546. Show a line containing various information for each input video frame. The input video is not modified.
  3547.  
  3548. The shown line contains a sequence of key/value pairs of the form key:value.
  3549.  
  3550. A description of each shown parameter follows:
  3551.  
  3552. n sequential number of the input frame, starting from 0
  3553.  
  3554. pts Presentation TimeStamp of the input frame, expressed as a number of time base units. The time base unit depends on the filter input pad.
  3555.  
  3556. pts_time
  3557. Presentation TimeStamp of the input frame, expressed as a number of seconds
  3558.  
  3559. pos position of the frame in the input stream, -1 if this information in unavailable and/or meaningless (for example in case of synthetic video)
  3560.  
  3561. fmt pixel format name
  3562.  
  3563. sar sample aspect ratio of the input frame, expressed in the form num/den
  3564.  
  3565. s size of the input frame, expressed in the form widthxheight
  3566.  
  3567. i interlaced mode ("P" for "progressive", "T" for top field first, "B" for bottom field first)
  3568.  
  3569. iskey
  3570. 1 if the frame is a key frame, 0 otherwise
  3571.  
  3572. type
  3573. picture type of the input frame ("I" for an I-frame, "P" for a P-frame, "B" for a B-frame, "?" for unknown type). Check also the documentation of the "AVPictureType"
  3574. enum and of the "av_get_picture_type_char" function defined in libavutil/avutil.h.
  3575.  
  3576. checksum
  3577. Adler-32 checksum of all the planes of the input frame
  3578.  
  3579. plane_checksum
  3580. Adler-32 checksum of each plane of the input frame, expressed in the form "[c0 c1 c2 c3]"
  3581.  
  3582. slicify
  3583. Pass the images of input video on to next video filter as multiple slices.
  3584.  
  3585. ./avconv -i in.avi -vf "slicify=32" out.avi
  3586.  
  3587. The filter accepts the slice height as parameter. If the parameter is not specified it will use the default value of 16.
  3588.  
  3589. Adding this in the beginning of filter chains should make filtering faster due to better use of the memory cache.
  3590.  
  3591. transpose
  3592. Transpose rows with columns in the input video and optionally flip it.
  3593.  
  3594. It accepts a parameter representing an integer, which can assume the values:
  3595.  
  3596. 0 Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  3597.  
  3598. L.R L.l
  3599. . . -> . .
  3600. l.r R.r
  3601.  
  3602. 1 Rotate by 90 degrees clockwise, that is:
  3603.  
  3604. L.R l.L
  3605. . . -> . .
  3606. l.r r.R
  3607.  
  3608. 2 Rotate by 90 degrees counterclockwise, that is:
  3609.  
  3610. L.R R.r
  3611. . . -> . .
  3612. l.r L.l
  3613.  
  3614. 3 Rotate by 90 degrees clockwise and vertically flip, that is:
  3615.  
  3616. L.R r.R
  3617. . . -> . .
  3618. l.r l.L
  3619.  
  3620. unsharp
  3621. Sharpen or blur the input video.
  3622.  
  3623. It accepts the following parameters: luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount
  3624.  
  3625. Negative values for the amount will blur the input video, while positive values will sharpen. All parameters are optional and default to the equivalent of the string
  3626. '5:5:1.0:5:5:0.0'.
  3627.  
  3628. luma_msize_x
  3629. Set the luma matrix horizontal size. It can be an integer between 3 and 13, default value is 5.
  3630.  
  3631. luma_msize_y
  3632. Set the luma matrix vertical size. It can be an integer between 3 and 13, default value is 5.
  3633.  
  3634. luma_amount
  3635. Set the luma effect strength. It can be a float number between -2.0 and 5.0, default value is 1.0.
  3636.  
  3637. chroma_msize_x
  3638. Set the chroma matrix horizontal size. It can be an integer between 3 and 13, default value is 5.
  3639.  
  3640. chroma_msize_y
  3641. Set the chroma matrix vertical size. It can be an integer between 3 and 13, default value is 5.
  3642.  
  3643. luma_amount
  3644. Set the chroma effect strength. It can be a float number between -2.0 and 5.0, default value is 0.0.
  3645.  
  3646. # Strong luma sharpen effect parameters
  3647. unsharp=7:7:2.5
  3648.  
  3649. # Strong blur of both luma and chroma parameters
  3650. unsharp=7:7:-2:7:7:-2
  3651.  
  3652. # Use the default values with B<avconv>
  3653. ./avconv -i in.avi -vf "unsharp" out.mp4
  3654.  
  3655. vflip
  3656. Flip the input video vertically.
  3657.  
  3658. ./avconv -i in.avi -vf "vflip" out.avi
  3659.  
  3660. yadif
  3661. Deinterlace the input video ("yadif" means "yet another deinterlacing filter").
  3662.  
  3663. It accepts the optional parameters: mode:parity:auto.
  3664.  
  3665. mode specifies the interlacing mode to adopt, accepts one of the following values:
  3666.  
  3667. 0 output 1 frame for each frame
  3668.  
  3669. 1 output 1 frame for each field
  3670.  
  3671. 2 like 0 but skips spatial interlacing check
  3672.  
  3673. 3 like 1 but skips spatial interlacing check
  3674.  
  3675. Default value is 0.
  3676.  
  3677. parity specifies the picture field parity assumed for the input interlaced video, accepts one of the following values:
  3678.  
  3679. 0 assume top field first
  3680.  
  3681. 1 assume bottom field first
  3682.  
  3683. -1 enable automatic detection
  3684.  
  3685. Default value is -1. If interlacing is unknown or decoder does not export this information, top field first will be assumed.
  3686.  
  3687. auto specifies if deinterlacer should trust the interlaced flag and only deinterlace frames marked as interlaced
  3688.  
  3689. 0 deinterlace all frames
  3690.  
  3691. 1 only deinterlace frames marked as interlaced
  3692.  
  3693. Default value is 0.
  3694.  
  3695. VIDEO SOURCES
  3696. Below is a description of the currently available video sources.
  3697.  
  3698. buffer
  3699. Buffer video frames, and make them available to the filter chain.
  3700.  
  3701. This source is mainly intended for a programmatic use, in particular through the interface defined in libavfilter/vsrc_buffer.h.
  3702.  
  3703. It accepts the following parameters: width:height:pix_fmt_string:timebase_num:timebase_den:sample_aspect_ratio_num:sample_aspect_ratio.den
  3704.  
  3705. All the parameters need to be explicitly defined.
  3706.  
  3707. Follows the list of the accepted parameters.
  3708.  
  3709. width, height
  3710. Specify the width and height of the buffered video frames.
  3711.  
  3712. pix_fmt_string
  3713. A string representing the pixel format of the buffered video frames. It may be a number corresponding to a pixel format, or a pixel format name.
  3714.  
  3715. timebase_num, timebase_den
  3716. Specify numerator and denomitor of the timebase assumed by the timestamps of the buffered frames.
  3717.  
  3718. sample_aspect_ratio.num, sample_aspect_ratio.den
  3719. Specify numerator and denominator of the sample aspect ratio assumed by the video frames.
  3720.  
  3721. For example:
  3722.  
  3723. buffer=320:240:yuv410p:1:24:1:1
  3724.  
  3725. will instruct the source to accept video frames with size 320x240 and with format "yuv410p", assuming 1/24 as the timestamps timebase and square pixels (1:1 sample aspect
  3726. ratio). Since the pixel format with name "yuv410p" corresponds to the number 6 (check the enum PixelFormat definition in libavutil/pixfmt.h), this example corresponds
  3727. to:
  3728.  
  3729. buffer=320:240:6:1:24
  3730.  
  3731. color
  3732. Provide an uniformly colored input.
  3733.  
  3734. It accepts the following parameters: color:frame_size:frame_rate
  3735.  
  3736. Follows the description of the accepted parameters.
  3737.  
  3738. color
  3739. Specify the color of the source. It can be the name of a color (case insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an alpha specifier. The
  3740. default value is "black".
  3741.  
  3742. frame_size
  3743. Specify the size of the sourced video, it may be a string of the form widthxheight, or the name of a size abbreviation. The default value is "320x240".
  3744.  
  3745. frame_rate
  3746. Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an
  3747. integer number, a float number or a valid video frame rate abbreviation. The default value is "25".
  3748.  
  3749. For example the following graph description will generate a red source with an opacity of 0.2, with size "qcif" and a frame rate of 10 frames per second, which will be
  3750. overlayed over the source connected to the pad with identifier "in".
  3751.  
  3752. "[email protected]:qcif:10 [color]; [in][color] overlay [out]"
  3753.  
  3754. movie
  3755. Read a video stream from a movie container.
  3756.  
  3757. It accepts the syntax: movie_name[:options] where movie_name is the name of the resource to read (not necessarily a file but also a device or a stream accessed through
  3758. some protocol), and options is an optional sequence of key=value pairs, separated by ":".
  3759.  
  3760. The description of the accepted options follows.
  3761.  
  3762. format_name, f
  3763. Specifies the format assumed for the movie to read, and can be either the name of a container or an input device. If not specified the format is guessed from
  3764. movie_name or by probing.
  3765.  
  3766. seek_point, sp
  3767. Specifies the seek point in seconds, the frames will be output starting from this seek point, the parameter is evaluated with "av_strtod" so the numerical value may
  3768. be suffixed by an IS postfix. Default value is "0".
  3769.  
  3770. stream_index, si
  3771. Specifies the index of the video stream to read. If the value is -1, the best suited video stream will be automatically selected. Default value is "-1".
  3772.  
  3773. This filter allows to overlay a second video on top of main input of a filtergraph as shown in this graph:
  3774.  
  3775. input -----------> deltapts0 --> overlay --> output
  3776. ^
  3777. |
  3778. movie --> scale--> deltapts1 -------+
  3779.  
  3780. Some examples follow:
  3781.  
  3782. # skip 3.2 seconds from the start of the avi file in.avi, and overlay it
  3783. # on top of the input labelled as "in".
  3784. movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
  3785. [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
  3786.  
  3787. # read from a video4linux2 device, and overlay it on top of the input
  3788. # labelled as "in"
  3789. movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
  3790. [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
  3791.  
  3792. nullsrc
  3793. Null video source, never return images. It is mainly useful as a template and to be employed in analysis / debugging tools.
  3794.  
  3795. It accepts as optional parameter a string of the form width:height:timebase.
  3796.  
  3797. width and height specify the size of the configured source. The default values of width and height are respectively 352 and 288 (corresponding to the CIF size format).
  3798.  
  3799. timebase specifies an arithmetic expression representing a timebase. The expression can contain the constants "PI", "E", "PHI", "AVTB" (the default timebase), and
  3800. defaults to the value "AVTB".
  3801.  
  3802. frei0r_src
  3803. Provide a frei0r source.
  3804.  
  3805. To enable compilation of this filter you need to install the frei0r header and configure Libav with --enable-frei0r.
  3806.  
  3807. The source supports the syntax:
  3808.  
  3809. <size>:<rate>:<src_name>[{=|:}<param1>:<param2>:...:<paramN>]
  3810.  
  3811. size is the size of the video to generate, may be a string of the form widthxheight or a frame size abbreviation. rate is the rate of the video to generate, may be a
  3812. string of the form num/den or a frame rate abbreviation. src_name is the name to the frei0r source to load. For more information regarding frei0r and how to set the
  3813. parameters read the section frei0r in the description of the video filters.
  3814.  
  3815. Some examples follow:
  3816.  
  3817. # generate a frei0r partik0l source with size 200x200 and framerate 10
  3818. # which is overlayed on the overlay filter main input
  3819. frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
  3820.  
  3821. rgbtestsrc, testsrc
  3822. The "rgbtestsrc" source generates an RGB test pattern useful for detecting RGB vs BGR issues. You should see a red, green and blue stripe from top to bottom.
  3823.  
  3824. The "testsrc" source generates a test video pattern, showing a color pattern, a scrolling gradient and a timestamp. This is mainly intended for testing purposes.
  3825.  
  3826. Both sources accept an optional sequence of key=value pairs, separated by ":". The description of the accepted options follows.
  3827.  
  3828. size, s
  3829. Specify the size of the sourced video, it may be a string of the form widthxheight, or the name of a size abbreviation. The default value is "320x240".
  3830.  
  3831. rate, r
  3832. Specify the frame rate of the sourced video, as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an
  3833. integer number, a float number or a valid video frame rate abbreviation. The default value is "25".
  3834.  
  3835. sar Set the sample aspect ratio of the sourced video.
  3836.  
  3837. duration
  3838. Set the video duration of the sourced video. The accepted syntax is:
  3839.  
  3840. [-]HH[:MM[:SS[.m...]]]
  3841. [-]S+[.m...]
  3842.  
  3843. See also the function "av_parse_time()".
  3844.  
  3845. If not specified, or the expressed duration is negative, the video is supposed to be generated forever.
  3846.  
  3847. For example the following:
  3848.  
  3849. testsrc=duration=5.3:size=qcif:rate=10
  3850.  
  3851. will generate a video with a duration of 5.3 seconds, with size 176x144 and a framerate of 10 frames per second.
  3852.  
  3853. VIDEO SINKS
  3854. Below is a description of the currently available video sinks.
  3855.  
  3856. nullsink
  3857. Null video sink, do absolutely nothing with the input video. It is mainly useful as a template and to be employed in analysis / debugging tools.
  3858.  
  3859. METADATA
  3860. Libav is able to dump metadata from media files into a simple UTF-8-encoded INI-like text file and then load it back using the metadata muxer/demuxer.
  3861.  
  3862. The file format is as follows:
  3863.  
  3864. 1. A file consists of a header and a number of metadata tags divided into sections, each on its own line.
  3865.  
  3866. 2. The header is a ';FFMETADATA' string, followed by a version number (now 1).
  3867.  
  3868. 3. Metadata tags are of the form 'key=value'
  3869.  
  3870. 4. Immediately after header follows global metadata
  3871.  
  3872. 5. After global metadata there may be sections with per-stream/per-chapter metadata.
  3873.  
  3874. 6. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in brackets ('[', ']') and ends with next section or end of file.
  3875.  
  3876. 7. At the beginning of a chapter section there may be an optional timebase to be used for start/end values. It must be in form 'TIMEBASE=num/den', where num and den are
  3877. integers. If the timebase is missing then start/end times are assumed to be in milliseconds. Next a chapter section must contain chapter start and end times in form
  3878. 'START=num', 'END=num', where num is a positive integer.
  3879.  
  3880. 8. Empty lines and lines starting with ';' or '#' are ignored.
  3881.  
  3882. 9. Metadata keys or values containing special characters ('=', ';', '#', '\' and a newline) must be escaped with a backslash '\'.
  3883.  
  3884. 10. Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of the tag (in the example above key is 'foo ', value is ' bar').
  3885.  
  3886. A ffmetadata file might look like this:
  3887.  
  3888. ;FFMETADATA1
  3889. title=bike\\shed
  3890. ;this is a comment
  3891. artist=Libav troll team
  3892.  
  3893. [CHAPTER]
  3894. TIMEBASE=1/1000
  3895. START=0
  3896. #chapter ends at 0:01:00
  3897. END=60000
  3898. title=chapter \#1
  3899. [STREAM]
  3900. title=multi\
  3901. line
  3902.  
  3903. SEE ALSO
  3904. avplay(1), avprobe(1), avserver(1) and the Libav HTML documentation
  3905.  
  3906. AUTHORS
  3907. The Libav developers
  3908.  
  3909.  
  3910.  
  3911. 2014-02-06 FFMPEG(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement