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.

505 lines
14KB

  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 "-devices" of the ff* tools will display the list of
  13. enabled output devices.
  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 one 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 -c:v 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 decklink
  93. The decklink output device provides playback capabilities for Blackmagic
  94. DeckLink devices.
  95. To enable this output device, you need the Blackmagic DeckLink SDK and you
  96. need to configure with the appropriate @code{--extra-cflags}
  97. and @code{--extra-ldflags}.
  98. On Windows, you need to run the IDL files through @command{widl}.
  99. DeckLink is very picky about the formats it supports. Pixel format is always
  100. uyvy422, framerate, field order and video size must be determined for your
  101. device with @command{-list_formats 1}. Audio sample rate is always 48 kHz.
  102. @subsection Options
  103. @table @option
  104. @item list_devices
  105. If set to @option{true}, print a list of devices and exit.
  106. Defaults to @option{false}.
  107. @item list_formats
  108. If set to @option{true}, print a list of supported formats and exit.
  109. Defaults to @option{false}.
  110. @item preroll
  111. Amount of time to preroll video in seconds.
  112. Defaults to @option{0.5}.
  113. @end table
  114. @subsection Examples
  115. @itemize
  116. @item
  117. List output devices:
  118. @example
  119. ffmpeg -i test.avi -f decklink -list_devices 1 dummy
  120. @end example
  121. @item
  122. List supported formats:
  123. @example
  124. ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
  125. @end example
  126. @item
  127. Play video clip:
  128. @example
  129. ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
  130. @end example
  131. @item
  132. Play video clip with non-standard framerate or video size:
  133. @example
  134. ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
  135. @end example
  136. @end itemize
  137. @section fbdev
  138. Linux framebuffer output device.
  139. The Linux framebuffer is a graphic hardware-independent abstraction
  140. layer to show graphics on a computer monitor, typically on the
  141. console. It is accessed through a file device node, usually
  142. @file{/dev/fb0}.
  143. For more detailed information read the file
  144. @file{Documentation/fb/framebuffer.txt} included in the Linux source tree.
  145. @subsection Options
  146. @table @option
  147. @item xoffset
  148. @item yoffset
  149. Set x/y coordinate of top left corner. Default is 0.
  150. @end table
  151. @subsection Examples
  152. Play a file on framebuffer device @file{/dev/fb0}.
  153. Required pixel format depends on current framebuffer settings.
  154. @example
  155. ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  156. @end example
  157. See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
  158. @section libndi_newtek
  159. The libndi_newtek output device provides playback capabilities for using NDI (Network
  160. Device Interface, standard created by NewTek).
  161. Output filename is a NDI name.
  162. To enable this output device, you need the NDI SDK and you
  163. need to configure with the appropriate @code{--extra-cflags}
  164. and @code{--extra-ldflags}.
  165. NDI uses uyvy422 pixel format natively, but also supports bgra, bgr0, rgba and
  166. rgb0.
  167. @subsection Options
  168. @table @option
  169. @item reference_level
  170. The audio reference level in dB. This specifies how many dB above the
  171. reference level (+4dBU) is the full range of 16 bit audio.
  172. Defaults to @option{0}.
  173. @item clock_video
  174. These specify whether video "clock" themselves.
  175. Defaults to @option{false}.
  176. @item clock_audio
  177. These specify whether audio "clock" themselves.
  178. Defaults to @option{false}.
  179. @end table
  180. @subsection Examples
  181. @itemize
  182. @item
  183. Play video clip:
  184. @example
  185. ffmpeg -i "udp://@@239.1.1.1:10480?fifo_size=1000000&overrun_nonfatal=1" -vf "scale=720:576,fps=fps=25,setdar=dar=16/9,format=pix_fmts=uyvy422" -f libndi_newtek NEW_NDI1
  186. @end example
  187. @end itemize
  188. @section opengl
  189. OpenGL output device.
  190. To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
  191. This output device allows one to render to OpenGL context.
  192. Context may be provided by application or default SDL window is created.
  193. When device renders to external context, application must implement handlers for following messages:
  194. @code{AV_DEV_TO_APP_CREATE_WINDOW_BUFFER} - create OpenGL context on current thread.
  195. @code{AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER} - make OpenGL context current.
  196. @code{AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER} - swap buffers.
  197. @code{AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER} - destroy OpenGL context.
  198. Application is also required to inform a device about current resolution by sending @code{AV_APP_TO_DEV_WINDOW_SIZE} message.
  199. @subsection Options
  200. @table @option
  201. @item background
  202. Set background color. Black is a default.
  203. @item no_window
  204. Disables default SDL window when set to non-zero value.
  205. Application must provide OpenGL context and both @code{window_size_cb} and @code{window_swap_buffers_cb} callbacks when set.
  206. @item window_title
  207. Set the SDL window title, if not specified default to the filename specified for the output device.
  208. Ignored when @option{no_window} is set.
  209. @item window_size
  210. Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
  211. If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
  212. Mostly usable when @option{no_window} is not set.
  213. @end table
  214. @subsection Examples
  215. Play a file on SDL window using OpenGL rendering:
  216. @example
  217. ffmpeg -i INPUT -f opengl "window title"
  218. @end example
  219. @section oss
  220. OSS (Open Sound System) output device.
  221. @section pulse
  222. PulseAudio output device.
  223. To enable this output device you need to configure FFmpeg with @code{--enable-libpulse}.
  224. More information about PulseAudio can be found on @url{http://www.pulseaudio.org}
  225. @subsection Options
  226. @table @option
  227. @item server
  228. Connect to a specific PulseAudio server, specified by an IP address.
  229. Default server is used when not provided.
  230. @item name
  231. Specify the application name PulseAudio will use when showing active clients,
  232. by default it is the @code{LIBAVFORMAT_IDENT} string.
  233. @item stream_name
  234. Specify the stream name PulseAudio will use when showing active streams,
  235. by default it is set to the specified output name.
  236. @item device
  237. Specify the device to use. Default device is used when not provided.
  238. List of output devices can be obtained with command @command{pactl list sinks}.
  239. @item buffer_size
  240. @item buffer_duration
  241. Control the size and duration of the PulseAudio buffer. A small buffer
  242. gives more control, but requires more frequent updates.
  243. @option{buffer_size} specifies size in bytes while
  244. @option{buffer_duration} specifies duration in milliseconds.
  245. When both options are provided then the highest value is used
  246. (duration is recalculated to bytes using stream parameters). If they
  247. are set to 0 (which is default), the device will use the default
  248. PulseAudio duration value. By default PulseAudio set buffer duration
  249. to around 2 seconds.
  250. @item prebuf
  251. Specify pre-buffering size in bytes. The server does not start with
  252. playback before at least @option{prebuf} bytes are available in the
  253. buffer. By default this option is initialized to the same value as
  254. @option{buffer_size} or @option{buffer_duration} (whichever is bigger).
  255. @item minreq
  256. Specify minimum request size in bytes. The server does not request less
  257. than @option{minreq} bytes from the client, instead waits until the buffer
  258. is free enough to request more bytes at once. It is recommended to not set
  259. this option, which will initialize this to a value that is deemed sensible
  260. by the server.
  261. @end table
  262. @subsection Examples
  263. Play a file on default device on default server:
  264. @example
  265. ffmpeg -i INPUT -f pulse "stream name"
  266. @end example
  267. @section sdl
  268. SDL (Simple DirectMedia Layer) output device.
  269. This output device allows one to show a video stream in an SDL
  270. window. Only one SDL window is allowed per application, so you can
  271. have only one instance of this output device in an application.
  272. To enable this output device you need libsdl installed on your system
  273. when configuring your build.
  274. For more information about SDL, check:
  275. @url{http://www.libsdl.org/}
  276. @subsection Options
  277. @table @option
  278. @item window_title
  279. Set the SDL window title, if not specified default to the filename
  280. specified for the output device.
  281. @item icon_title
  282. Set the name of the iconified SDL window, if not specified it is set
  283. to the same value of @var{window_title}.
  284. @item window_size
  285. Set the SDL window size, can be a string of the form
  286. @var{width}x@var{height} or a video size abbreviation.
  287. If not specified it defaults to the size of the input video,
  288. downscaled according to the aspect ratio.
  289. @item window_fullscreen
  290. Set fullscreen mode when non-zero value is provided.
  291. Default value is zero.
  292. @item window_enable_quit
  293. Enable quit action (using window button or keyboard key)
  294. when non-zero value is provided.
  295. Default value is 1 (enable quit action)
  296. @end table
  297. @subsection Interactive commands
  298. The window created by the device can be controlled through the
  299. following interactive commands.
  300. @table @key
  301. @item q, ESC
  302. Quit the device immediately.
  303. @end table
  304. @subsection Examples
  305. The following command shows the @command{ffmpeg} output is an
  306. SDL window, forcing its size to the qcif format:
  307. @example
  308. ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
  309. @end example
  310. @section sndio
  311. sndio audio output device.
  312. @section v4l2
  313. Video4Linux2 output device.
  314. @section xv
  315. XV (XVideo) output device.
  316. This output device allows one to show a video stream in a X Window System
  317. window.
  318. @subsection Options
  319. @table @option
  320. @item display_name
  321. Specify the hardware display name, which determines the display and
  322. communications domain to be used.
  323. The display name or DISPLAY environment variable can be a string in
  324. the format @var{hostname}[:@var{number}[.@var{screen_number}]].
  325. @var{hostname} specifies the name of the host machine on which the
  326. display is physically attached. @var{number} specifies the number of
  327. the display server on that host machine. @var{screen_number} specifies
  328. the screen to be used on that server.
  329. If unspecified, it defaults to the value of the DISPLAY environment
  330. variable.
  331. For example, @code{dual-headed:0.1} would specify screen 1 of display
  332. 0 on the machine named ``dual-headed''.
  333. Check the X11 specification for more detailed information about the
  334. display name format.
  335. @item window_id
  336. When set to non-zero value then device doesn't create new window,
  337. but uses existing one with provided @var{window_id}. By default
  338. this options is set to zero and device creates its own window.
  339. @item window_size
  340. Set the created window size, can be a string of the form
  341. @var{width}x@var{height} or a video size abbreviation. If not
  342. specified it defaults to the size of the input video.
  343. Ignored when @var{window_id} is set.
  344. @item window_x
  345. @item window_y
  346. Set the X and Y window offsets for the created window. They are both
  347. set to 0 by default. The values may be ignored by the window manager.
  348. Ignored when @var{window_id} is set.
  349. @item window_title
  350. Set the window title, if not specified default to the filename
  351. specified for the output device. Ignored when @var{window_id} is set.
  352. @end table
  353. For more information about XVideo see @url{http://www.x.org/}.
  354. @subsection Examples
  355. @itemize
  356. @item
  357. Decode, display and encode video input with @command{ffmpeg} at the
  358. same time:
  359. @example
  360. ffmpeg -i INPUT OUTPUT -f xv display
  361. @end example
  362. @item
  363. Decode and display the input video to multiple X11 windows:
  364. @example
  365. ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  366. @end example
  367. @end itemize
  368. @c man end OUTPUT DEVICES