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.

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