You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.9KB

  1. \input texinfo @c -*- texinfo -*-
  2. @settitle Libavfilter Documentation
  3. @titlepage
  4. @center @titlefont{Libavfilter Documentation}
  5. @end titlepage
  6. @top
  7. @contents
  8. @chapter Introduction
  9. Libavfilter is the filtering API of Libav. It replaces 'vhooks', and
  10. started as a Google Summer of Code project.
  11. Note that there may still be serious bugs in the code and its API
  12. and ABI should not be considered stable yet!
  13. @chapter Tutorial
  14. In libavfilter, it is possible for filters to have multiple inputs and
  15. multiple outputs.
  16. To illustrate the sorts of things that are possible, we can
  17. use a complex filter graph. For example, the following one:
  18. @example
  19. input --> split --> fifo -----------------------> overlay --> output
  20. | ^
  21. | |
  22. +------> fifo --> crop --> vflip --------+
  23. @end example
  24. splits the stream in two streams, then sends one stream through the crop filter
  25. and the vflip filter, before merging it back with the other stream by
  26. overlaying it on top. You can use the following command to achieve this:
  27. @example
  28. ./avconv -i input -vf "[in] split [T1], fifo, [T2] overlay=0:H/2 [out]; [T1] fifo, crop=iw:ih/2:0:ih/2, vflip [T2]" output
  29. @end example
  30. The result will be that the top half of the video is mirrored
  31. onto the bottom half of the output video.
  32. Video filters are loaded using the @var{-vf} option passed to
  33. avconv or to avplay. Filters in the same linear chain are separated by
  34. commas. In our example, @var{split}, @var{fifo}, and @var{overlay} are in one
  35. linear chain, and @var{fifo}, @var{crop}, and @var{vflip} are in another. The
  36. points where the linear chains join are labeled by names enclosed in square
  37. brackets. In our example, they join at @var{[T1]} and @var{[T2]}. The magic
  38. labels @var{[in]} and @var{[out]} are the points where video is input
  39. and output.
  40. Some filters take a list of parameters: they are specified
  41. after the filter name and an equal sign, and are separated
  42. by a semicolon.
  43. There are so-called @var{source filters} that do not take video
  44. input, and we expect that some @var{sink filters} will
  45. not have video output, at some point in the future.
  46. @chapter graph2dot
  47. The @file{graph2dot} program included in the Libav @file{tools}
  48. directory can be used to parse a filter graph description and issue a
  49. corresponding textual representation in the dot language.
  50. Invoke the command:
  51. @example
  52. graph2dot -h
  53. @end example
  54. to see how to use @file{graph2dot}.
  55. You can then pass the dot description to the @file{dot} program (from
  56. the graphviz suite of programs) and obtain a graphical representation
  57. of the filter graph.
  58. For example the sequence of commands:
  59. @example
  60. echo @var{GRAPH_DESCRIPTION} | \
  61. tools/graph2dot -o graph.tmp && \
  62. dot -Tpng graph.tmp -o graph.png && \
  63. display graph.png
  64. @end example
  65. can be used to create and display an image representing the graph
  66. described by the @var{GRAPH_DESCRIPTION} string.
  67. @include filters.texi
  68. @bye