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.

364 lines
10KB

  1. @chapter Output Devices
  2. @c man begin OUTPUT DEVICES
  3. Output devices are configured elements in FFmpeg that can write
  4. multimedia data to an output device attached to your system.
  5. When you configure your FFmpeg build, all the supported output devices
  6. are enabled by default. You can list all available ones using the
  7. configure option "--list-outdevs".
  8. You can disable all the output devices using the configure option
  9. "--disable-outdevs", and selectively enable an output device using the
  10. option "--enable-outdev=@var{OUTDEV}", or you can disable a particular
  11. input device using the option "--disable-outdev=@var{OUTDEV}".
  12. The option "-formats" of the ff* tools will display the list of
  13. enabled output devices (amongst the muxers).
  14. A description of the currently available output devices follows.
  15. @section alsa
  16. ALSA (Advanced Linux Sound Architecture) output device.
  17. @subsection Examples
  18. @itemize
  19. @item
  20. Play a file on default ALSA device:
  21. @example
  22. ffmpeg -i INPUT -f alsa default
  23. @end example
  24. @item
  25. Play a file on soundcard 1, audio device 7:
  26. @example
  27. ffmpeg -i INPUT -f alsa hw:1,7
  28. @end example
  29. @end itemize
  30. @section caca
  31. CACA output device.
  32. This output device allows to show a video stream in CACA window.
  33. Only one CACA window is allowed per application, so you can
  34. have only one instance of this output device in an application.
  35. To enable this output device you need to configure FFmpeg with
  36. @code{--enable-libcaca}.
  37. libcaca is a graphics library that outputs text instead of pixels.
  38. For more information about libcaca, check:
  39. @url{http://caca.zoy.org/wiki/libcaca}
  40. @subsection Options
  41. @table @option
  42. @item window_title
  43. Set the CACA window title, if not specified default to the filename
  44. specified for the output device.
  45. @item window_size
  46. Set the CACA window size, can be a string of the form
  47. @var{width}x@var{height} or a video size abbreviation.
  48. If not specified it defaults to the size of the input video.
  49. @item driver
  50. Set display driver.
  51. @item algorithm
  52. Set dithering algorithm. Dithering is necessary
  53. because the picture being rendered has usually far more colours than
  54. the available palette.
  55. The accepted values are listed with @code{-list_dither algorithms}.
  56. @item antialias
  57. Set antialias method. Antialiasing smoothens the rendered
  58. image and avoids the commonly seen staircase effect.
  59. The accepted values are listed with @code{-list_dither antialiases}.
  60. @item charset
  61. Set which characters are going to be used when rendering text.
  62. The accepted values are listed with @code{-list_dither charsets}.
  63. @item color
  64. Set color to be used when rendering text.
  65. The accepted values are listed with @code{-list_dither colors}.
  66. @item list_drivers
  67. If set to @option{true}, print a list of available drivers and exit.
  68. @item list_dither
  69. List available dither options related to the argument.
  70. The argument must be one of @code{algorithms}, @code{antialiases},
  71. @code{charsets}, @code{colors}.
  72. @end table
  73. @subsection Examples
  74. @itemize
  75. @item
  76. The following command shows the @command{ffmpeg} output is an
  77. CACA window, forcing its size to 80x25:
  78. @example
  79. ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  80. @end example
  81. @item
  82. Show the list of available drivers and exit:
  83. @example
  84. ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  85. @end example
  86. @item
  87. Show the list of available dither colors and exit:
  88. @example
  89. ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  90. @end example
  91. @end itemize
  92. @section fbdev
  93. Linux framebuffer output device.
  94. The Linux framebuffer is a graphic hardware-independent abstraction
  95. layer to show graphics on a computer monitor, typically on the
  96. console. It is accessed through a file device node, usually
  97. @file{/dev/fb0}.
  98. For more detailed information read the file
  99. @file{Documentation/fb/framebuffer.txt} included in the Linux source tree.
  100. @subsection Options
  101. @table @option
  102. @item xoffset
  103. @item yoffset
  104. Set x/y coordinate of top left corner. Default is 0.
  105. @end table
  106. @subsection Examples
  107. Play a file on framebuffer device @file{/dev/fb0}.
  108. Required pixel format depends on current framebuffer settings.
  109. @example
  110. ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  111. @end example
  112. See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
  113. @section opengl
  114. OpenGL output device.
  115. To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
  116. Device allows to render to OpenGL context.
  117. Context may be provided by application or default SDL window is created.
  118. When device renders to external context, application must implement handlers for following messages:
  119. @code{AV_CTL_MESSAGE_CREATE_WINDOW_BUFFER} - create OpenGL context on current thread.
  120. @code{AV_CTL_MESSAGE_PREPARE_WINDOW_BUFFER} - make OpenGL context current.
  121. @code{AV_CTL_MESSAGE_DISPLAY_WINDOW_BUFFER} - swap buffers.
  122. @code{AV_CTL_MESSAGE_DESTROY_WINDOW_BUFFER} - destroy OpenGL context.
  123. Application is also required to inform a device about current resolution by sending @code{AV_DEVICE_WINDOW_RESIZED} message.
  124. @subsection Options
  125. @table @option
  126. @item background
  127. Set background color. Black is a default.
  128. @item no_window
  129. Disables default SDL window when set to non-zero value.
  130. Application must provide OpenGL context and both @code{window_size_cb} and @code{window_swap_buffers_cb} callbacks when set.
  131. @item window_title
  132. Set the SDL window title, if not specified default to the filename specified for the output device.
  133. Ignored when @option{no_window} is set.
  134. @end table
  135. @subsection Examples
  136. Play a file on SDL window using OpenGL rendering:
  137. @example
  138. ffmpeg -i INPUT -f opengl "window title"
  139. @end example
  140. @section oss
  141. OSS (Open Sound System) output device.
  142. @section pulse
  143. PulseAudio output device.
  144. To enable this output device you need to configure FFmpeg with @code{--enable-libpulse}.
  145. More information about PulseAudio can be found on @url{http://www.pulseaudio.org}
  146. @subsection Options
  147. @table @option
  148. @item server
  149. Connect to a specific PulseAudio server, specified by an IP address.
  150. Default server is used when not provided.
  151. @item name
  152. Specify the application name PulseAudio will use when showing active clients,
  153. by default it is the @code{LIBAVFORMAT_IDENT} string.
  154. @item stream_name
  155. Specify the stream name PulseAudio will use when showing active streams,
  156. by default it is set to the specified output name.
  157. @item device
  158. Specify the device to use. Default device is used when not provided.
  159. List of output devices can be obtained with command @command{pactl list sinks}.
  160. @item buffer_size
  161. @item buffer_duration
  162. Control the size and duration of the PulseAudio buffer. A small buffer
  163. gives more control, but requires more frequent updates.
  164. @option{buffer_size} specifies size in bytes while
  165. @option{buffer_duration} specifies duration in milliseconds.
  166. When both options are provided then the highest value is used
  167. (duration is recalculated to bytes using stream parameters). If they
  168. are set to 0 (which is default), the device will use the default
  169. PulseAudio duration value. By default PulseAudio set buffer duration
  170. to around 2 seconds.
  171. @end table
  172. @subsection Examples
  173. Play a file on default device on default server:
  174. @example
  175. ffmpeg -i INPUT -f pulse "stream name"
  176. @end example
  177. @section sdl
  178. SDL (Simple DirectMedia Layer) output device.
  179. This output device allows to show a video stream in an SDL
  180. window. Only one SDL window is allowed per application, so you can
  181. have only one instance of this output device in an application.
  182. To enable this output device you need libsdl installed on your system
  183. when configuring your build.
  184. For more information about SDL, check:
  185. @url{http://www.libsdl.org/}
  186. @subsection Options
  187. @table @option
  188. @item window_title
  189. Set the SDL window title, if not specified default to the filename
  190. specified for the output device.
  191. @item icon_title
  192. Set the name of the iconified SDL window, if not specified it is set
  193. to the same value of @var{window_title}.
  194. @item window_size
  195. Set the SDL window size, can be a string of the form
  196. @var{width}x@var{height} or a video size abbreviation.
  197. If not specified it defaults to the size of the input video,
  198. downscaled according to the aspect ratio.
  199. @item window_fullscreen
  200. Set fullscreen mode when non-zero value is provided.
  201. Default value is zero.
  202. @end table
  203. @subsection Interactive commands
  204. The window created by the device can be controlled through the
  205. following interactive commands.
  206. @table @key
  207. @item q, ESC
  208. Quit the device immediately.
  209. @end table
  210. @subsection Examples
  211. The following command shows the @command{ffmpeg} output is an
  212. SDL window, forcing its size to the qcif format:
  213. @example
  214. ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
  215. @end example
  216. @section sndio
  217. sndio audio output device.
  218. @section xv
  219. XV (XVideo) output device.
  220. This output device allows to show a video stream in a X Window System
  221. window.
  222. @subsection Options
  223. @table @option
  224. @item display_name
  225. Specify the hardware display name, which determines the display and
  226. communications domain to be used.
  227. The display name or DISPLAY environment variable can be a string in
  228. the format @var{hostname}[:@var{number}[.@var{screen_number}]].
  229. @var{hostname} specifies the name of the host machine on which the
  230. display is physically attached. @var{number} specifies the number of
  231. the display server on that host machine. @var{screen_number} specifies
  232. the screen to be used on that server.
  233. If unspecified, it defaults to the value of the DISPLAY environment
  234. variable.
  235. For example, @code{dual-headed:0.1} would specify screen 1 of display
  236. 0 on the machine named ``dual-headed''.
  237. Check the X11 specification for more detailed information about the
  238. display name format.
  239. @item window_size
  240. Set the created window size, can be a string of the form
  241. @var{width}x@var{height} or a video size abbreviation. If not
  242. specified it defaults to the size of the input video.
  243. @item window_x
  244. @item window_y
  245. Set the X and Y window offsets for the created window. They are both
  246. set to 0 by default. The values may be ignored by the window manager.
  247. @item window_title
  248. Set the window title, if not specified default to the filename
  249. specified for the output device.
  250. @end table
  251. For more information about XVideo see @url{http://www.x.org/}.
  252. @subsection Examples
  253. @itemize
  254. @item
  255. Decode, display and encode video input with @command{ffmpeg} at the
  256. same time:
  257. @example
  258. ffmpeg -i INPUT OUTPUT -f xv display
  259. @end example
  260. @item
  261. Decode and display the input video to multiple X11 windows:
  262. @example
  263. ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  264. @end example
  265. @end itemize
  266. @c man end OUTPUT DEVICES