outdevs.texi 15 KB

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