libavfilter.texi 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 FFmpeg. It is the substitute of the
  10. now deprecated 'vhooks' and started as a Google Summer of Code project.
  11. Integrating libavfilter into the main FFmpeg repository is a work in
  12. progress. If you wish to try the unfinished development code of
  13. libavfilter then check it out from the libavfilter repository into
  14. some directory of your choice by:
  15. @example
  16. svn checkout svn://svn.ffmpeg.org/soc/libavfilter
  17. @end example
  18. And then read the README file in the top directory to learn how to
  19. integrate it into ffmpeg and ffplay.
  20. But note that there may still be serious bugs in the code and its API
  21. and ABI should not be considered stable yet!
  22. @chapter Tutorial
  23. In libavfilter, it is possible for filters to have multiple inputs and
  24. multiple outputs.
  25. To illustrate the sorts of things that are possible, we can
  26. use a complex filter graph. For example, the following one:
  27. @example
  28. input --> split --> fifo -----------------------> overlay --> output
  29. | ^
  30. | |
  31. +------> fifo --> crop --> vflip --------+
  32. @end example
  33. splits the stream in two streams, sends one stream through the crop filter
  34. and the vflip filter before merging it back with the other stream by
  35. overlaying it on top. You can use the following command to achieve this:
  36. @example
  37. ./ffmpeg -i in.avi -s 240x320 -vf "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
  38. @end example
  39. where input_video.avi has a vertical resolution of 480 pixels. The
  40. result will be that in output the top half of the video is mirrored
  41. onto the bottom half.
  42. Video filters are loaded using the @var{-vf} option passed to
  43. ffmpeg or to ffplay. Filters in the same linear chain are separated by
  44. commas. In our example, @var{split, fifo, overlay} are in one linear
  45. chain, and @var{fifo, crop, vflip} are in another. The points where
  46. the linear chains join are labeled by names enclosed in square
  47. brackets. In our example, that is @var{[T1]} and @var{[T2]}. The magic
  48. labels @var{[in]} and @var{[out]} are the points where video is input
  49. and output.
  50. Some filters take in input a list of parameters: they are specified
  51. after the filter name and an equal sign, and are separated each other
  52. by a semicolon.
  53. There exist so-called @var{source filters} that do not have a video
  54. input, and we expect in the future some @var{sink filters} that will
  55. not have video output.
  56. @chapter graph2dot
  57. The @file{graph2dot} program included in the FFmpeg @file{tools}
  58. directory can be used to parse a filter graph description and issue a
  59. corresponding textual representation in the dot language.
  60. Invoke the command:
  61. @example
  62. graph2dot -h
  63. @end example
  64. to see how to use @file{graph2dot}.
  65. You can then pass the dot description to the @file{dot} program (from
  66. the graphviz suite of programs) and obtain a graphical representation
  67. of the filter graph.
  68. For example the sequence of commands:
  69. @example
  70. echo @var{GRAPH_DESCRIPTION} | \
  71. tools/graph2dot -o graph.tmp && \
  72. dot -Tpng graph.tmp -o graph.png && \
  73. display graph.png
  74. @end example
  75. can be used to create and display an image representing the graph
  76. described by the @var{GRAPH_DESCRIPTION} string.
  77. @include filters.texi
  78. @bye