Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. =head1 NAME
  2.  
  3. ffmpeg-devices - FFmpeg devices
  4.  
  5. =head1 DESCRIPTION
  6.  
  7.  
  8. This document describes the input and output devices provided by the
  9. libavdevice library.
  10.  
  11.  
  12.  
  13. =head1 DEVICE OPTIONS
  14.  
  15.  
  16. The libavdevice library provides the same interface as
  17. libavformat. Namely, an input device is considered like a demuxer, and
  18. an output device like a muxer, and the interface and generic device
  19. options are the same provided by libavformat (see the ffmpeg-formats
  20. manual).
  21.  
  22. In addition each input or output device may support so-called private
  23. options, which are specific for that component.
  24.  
  25. Options may be set by specifying -I<option> I<value> in the
  26. FFmpeg tools, or by setting the value explicitly in the device
  27. C<AVFormatContext> options or using the F<libavutil/opt.h> API
  28. for programmatic use.
  29.  
  30.  
  31.  
  32. =head1 INPUT DEVICES
  33.  
  34.  
  35. Input devices are configured elements in FFmpeg which allow to access
  36. the data coming from a multimedia device attached to your system.
  37.  
  38. When you configure your FFmpeg build, all the supported input devices
  39. are enabled by default. You can list all available ones using the
  40. configure option "--list-indevs".
  41.  
  42. You can disable all the input devices using the configure option
  43. "--disable-indevs", and selectively enable an input device using the
  44. option "--enable-indev=I<INDEV>", or you can disable a particular
  45. input device using the option "--disable-indev=I<INDEV>".
  46.  
  47. The option "-formats" of the ff* tools will display the list of
  48. supported input devices (amongst the demuxers).
  49.  
  50. A description of the currently available input devices follows.
  51.  
  52.  
  53. =head2 alsa
  54.  
  55.  
  56. ALSA (Advanced Linux Sound Architecture) input device.
  57.  
  58. To enable this input device during configuration you need libasound
  59. installed on your system.
  60.  
  61. This device allows capturing from an ALSA device. The name of the
  62. device to capture has to be an ALSA card identifier.
  63.  
  64. An ALSA identifier has the syntax:
  65.        
  66.         hw:<CARD>[,<DEV>[,<SUBDEV>]]
  67.  
  68.  
  69. where the I<DEV> and I<SUBDEV> components are optional.
  70.  
  71. The three arguments (in order: I<CARD>,I<DEV>,I<SUBDEV>)
  72. specify card number or identifier, device number and subdevice number
  73. (-1 means any).
  74.  
  75. To see the list of cards currently recognized by your system check the
  76. files F</proc/asound/cards> and F</proc/asound/devices>.
  77.  
  78. For example to capture with B<ffmpeg> from an ALSA device with
  79. card id 0, you may run the command:
  80.        
  81.         ffmpeg -f alsa -i hw:0 alsaout.wav
  82.  
  83.  
  84. For more information see:
  85. E<lt>B<http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html>E<gt>
  86.  
  87.  
  88. =head2 bktr
  89.  
  90.  
  91. BSD video input device.
  92.  
  93.  
  94. =head2 dshow
  95.  
  96.  
  97. Windows DirectShow input device.
  98.  
  99. DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  100. Currently only audio and video devices are supported.
  101.  
  102. Multiple devices may be opened as separate inputs, but they may also be
  103. opened on the same input, which should improve synchronism between them.
  104.  
  105. The input name should be in the format:
  106.  
  107.        
  108.         <TYPE>=<NAME>[:<TYPE>=<NAME>]
  109.  
  110.  
  111. where I<TYPE> can be either I<audio> or I<video>,
  112. and I<NAME> is the device's name.
  113.  
  114.  
  115. =head3 Options
  116.  
  117.  
  118. If no options are specified, the device's defaults are used.
  119. If the device does not support the requested options, it will
  120. fail to open.
  121.  
  122.  
  123. =over 4
  124.  
  125.  
  126.  
  127. =item B<video_size>
  128.  
  129. Set the video size in the captured video.
  130.  
  131.  
  132. =item B<framerate>
  133.  
  134. Set the frame rate in the captured video.
  135.  
  136.  
  137. =item B<sample_rate>
  138.  
  139. Set the sample rate (in Hz) of the captured audio.
  140.  
  141.  
  142. =item B<sample_size>
  143.  
  144. Set the sample size (in bits) of the captured audio.
  145.  
  146.  
  147. =item B<channels>
  148.  
  149. Set the number of channels in the captured audio.
  150.  
  151.  
  152. =item B<list_devices>
  153.  
  154. If set to B<true>, print a list of devices and exit.
  155.  
  156.  
  157. =item B<list_options>
  158.  
  159. If set to B<true>, print a list of selected device's options
  160. and exit.
  161.  
  162.  
  163. =item B<video_device_number>
  164.  
  165. Set video device number for devices with same name (starts at 0,
  166. defaults to 0).
  167.  
  168.  
  169. =item B<audio_device_number>
  170.  
  171. Set audio device number for devices with same name (starts at 0,
  172. defaults to 0).
  173.  
  174.  
  175. =item B<pixel_format>
  176.  
  177. Select pixel format to be used by DirectShow. This may only be set when
  178. the video codec is not set or set to rawvideo.
  179.  
  180.  
  181. =item B<audio_buffer_size>
  182.  
  183. Set audio device buffer size in milliseconds (which can directly
  184. impact latency, depending on the device).
  185. Defaults to using the audio device's
  186. default buffer size (typically some multiple of 500ms).
  187. Setting this value too low can degrade performance.
  188. See also
  189. E<lt>B<http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx>E<gt>
  190.  
  191.  
  192. =back
  193.  
  194.  
  195.  
  196. =head3 Examples
  197.  
  198.  
  199.  
  200. =over 4
  201.  
  202.  
  203.  
  204. =item *
  205.  
  206. Print the list of DirectShow supported devices and exit:
  207.        
  208.         $ ffmpeg -list_devices true -f dshow -i dummy
  209.  
  210.  
  211.  
  212. =item *
  213.  
  214. Open video device I<Camera>:
  215.        
  216.         $ ffmpeg -f dshow -i video="Camera"
  217.  
  218.  
  219.  
  220. =item *
  221.  
  222. Open second video device with name I<Camera>:
  223.        
  224.         $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
  225.  
  226.  
  227.  
  228. =item *
  229.  
  230. Open video device I<Camera> and audio device I<Microphone>:
  231.        
  232.         $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
  233.  
  234.  
  235.  
  236. =item *
  237.  
  238. Print the list of supported options in selected device and exit:
  239.        
  240.         $ ffmpeg -list_options true -f dshow -i video="Camera"
  241.  
  242.  
  243.  
  244. =back
  245.  
  246.  
  247.  
  248. =head2 dv1394
  249.  
  250.  
  251. Linux DV 1394 input device.
  252.  
  253.  
  254. =head2 fbdev
  255.  
  256.  
  257. Linux framebuffer input device.
  258.  
  259. The Linux framebuffer is a graphic hardware-independent abstraction
  260. layer to show graphics on a computer monitor, typically on the
  261. console. It is accessed through a file device node, usually
  262. F</dev/fb0>.
  263.  
  264. For more detailed information read the file
  265. Documentation/fb/framebuffer.txt included in the Linux source tree.
  266.  
  267. To record from the framebuffer device F</dev/fb0> with
  268. B<ffmpeg>:
  269.        
  270.         ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
  271.  
  272.  
  273. You can take a single screenshot image with the command:
  274.        
  275.         ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
  276.  
  277.  
  278. See also E<lt>B<http://linux-fbdev.sourceforge.net/>E<gt>, and fbset(1).
  279.  
  280.  
  281. =head2 iec61883
  282.  
  283.  
  284. FireWire DV/HDV input device using libiec61883.
  285.  
  286. To enable this input device, you need libiec61883, libraw1394 and
  287. libavc1394 installed on your system. Use the configure option
  288. C<--enable-libiec61883> to compile with the device enabled.
  289.  
  290. The iec61883 capture device supports capturing from a video device
  291. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  292. FireWire stack (juju). This is the default DV/HDV input method in Linux
  293. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  294.  
  295. Specify the FireWire port to be used as input file, or "auto"
  296. to choose the first port connected.
  297.  
  298.  
  299. =head3 Options
  300.  
  301.  
  302.  
  303. =over 4
  304.  
  305.  
  306.  
  307. =item B<dvtype>
  308.  
  309. Override autodetection of DV/HDV. This should only be used if auto
  310. detection does not work, or if usage of a different device type
  311. should be prohibited. Treating a DV device as HDV (or vice versa) will
  312. not work and result in undefined behavior.
  313. The values B<auto>, B<dv> and B<hdv> are supported.
  314.  
  315.  
  316. =item B<dvbuffer>
  317.  
  318. Set maxiumum size of buffer for incoming data, in frames. For DV, this
  319. is an exact value. For HDV, it is not frame exact, since HDV does
  320. not have a fixed frame size.
  321.  
  322.  
  323. =item B<dvguid>
  324.  
  325. Select the capture device by specifying it's GUID. Capturing will only
  326. be performed from the specified device and fails if no device with the
  327. given GUID is found. This is useful to select the input if multiple
  328. devices are connected at the same time.
  329. Look at /sys/bus/firewire/devices to find out the GUIDs.
  330.  
  331.  
  332. =back
  333.  
  334.  
  335.  
  336. =head3 Examples
  337.  
  338.  
  339.  
  340. =over 4
  341.  
  342.  
  343.  
  344. =item *
  345.  
  346. Grab and show the input of a FireWire DV/HDV device.
  347.        
  348.         ffplay -f iec61883 -i auto
  349.  
  350.  
  351.  
  352. =item *
  353.  
  354. Grab and record the input of a FireWire DV/HDV device,
  355. using a packet buffer of 100000 packets if the source is HDV.
  356.        
  357.         ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
  358.  
  359.  
  360.  
  361. =back
  362.  
  363.  
  364.  
  365. =head2 jack
  366.  
  367.  
  368. JACK input device.
  369.  
  370. To enable this input device during configuration you need libjack
  371. installed on your system.
  372.  
  373. A JACK input device creates one or more JACK writable clients, one for
  374. each audio channel, with name I<client_name>:input_I<N>, where
  375. I<client_name> is the name provided by the application, and I<N>
  376. is a number which identifies the channel.
  377. Each writable client will send the acquired data to the FFmpeg input
  378. device.
  379.  
  380. Once you have created one or more JACK readable clients, you need to
  381. connect them to one or more JACK writable clients.
  382.  
  383. To connect or disconnect JACK clients you can use the B<jack_connect>
  384. and B<jack_disconnect> programs, or do it through a graphical interface,
  385. for example with B<qjackctl>.
  386.  
  387. To list the JACK clients and their properties you can invoke the command
  388. B<jack_lsp>.
  389.  
  390. Follows an example which shows how to capture a JACK readable client
  391. with B<ffmpeg>.
  392.        
  393.         # Create a JACK writable client with name "ffmpeg".
  394.         $ ffmpeg -f jack -i ffmpeg -y out.wav
  395.        
  396.         # Start the sample jack_metro readable client.
  397.         $ jack_metro -b 120 -d 0.2 -f 4000
  398.        
  399.         # List the current JACK clients.
  400.         $ jack_lsp -c
  401.         system:capture_1
  402.         system:capture_2
  403.         system:playback_1
  404.         system:playback_2
  405.         ffmpeg:input_1
  406.         metro:120_bpm
  407.        
  408.         # Connect metro to the ffmpeg writable client.
  409.         $ jack_connect metro:120_bpm ffmpeg:input_1
  410.  
  411.  
  412. For more information read:
  413. E<lt>B<http://jackaudio.org/>E<gt>
  414.  
  415.  
  416. =head2 lavfi
  417.  
  418.  
  419. Libavfilter input virtual device.
  420.  
  421. This input device reads data from the open output pads of a libavfilter
  422. filtergraph.
  423.  
  424. For each filtergraph open output, the input device will create a
  425. corresponding stream which is mapped to the generated output. Currently
  426. only video data is supported. The filtergraph is specified through the
  427. option B<graph>.
  428.  
  429.  
  430. =head3 Options
  431.  
  432.  
  433.  
  434. =over 4
  435.  
  436.  
  437.  
  438. =item B<graph>
  439.  
  440. Specify the filtergraph to use as input. Each video open output must be
  441. labelled by a unique string of the form "outI<N>", where I<N> is a
  442. number starting from 0 corresponding to the mapped input stream
  443. generated by the device.
  444. The first unlabelled output is automatically assigned to the "out0"
  445. label, but all the others need to be specified explicitly.
  446.  
  447. If not specified defaults to the filename specified for the input
  448. device.
  449.  
  450.  
  451. =item B<graph_file>
  452.  
  453. Set the filename of the filtergraph to be read and sent to the other
  454. filters. Syntax of the filtergraph is the same as the one specified by
  455. the option I<graph>.
  456.  
  457.  
  458. =back
  459.  
  460.  
  461.  
  462. =head3 Examples
  463.  
  464.  
  465.  
  466. =over 4
  467.  
  468.  
  469. =item *
  470.  
  471. Create a color video stream and play it back with B<ffplay>:
  472.        
  473.         ffplay -f lavfi -graph "color=c=pink [out0]" dummy
  474.  
  475.  
  476.  
  477. =item *
  478.  
  479. As the previous example, but use filename for specifying the graph
  480. description, and omit the "out0" label:
  481.        
  482.         ffplay -f lavfi color=c=pink
  483.  
  484.  
  485.  
  486. =item *
  487.  
  488. Create three different video test filtered sources and play them:
  489.        
  490.         ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
  491.  
  492.  
  493.  
  494. =item *
  495.  
  496. Read an audio stream from a file using the amovie source and play it
  497. back with B<ffplay>:
  498.        
  499.         ffplay -f lavfi "amovie=test.wav"
  500.  
  501.  
  502.  
  503. =item *
  504.  
  505. Read an audio stream and a video stream and play it back with
  506. B<ffplay>:
  507.        
  508.         ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
  509.  
  510.  
  511.  
  512. =back
  513.  
  514.  
  515.  
  516. =head2 libdc1394
  517.  
  518.  
  519. IIDC1394 input device, based on libdc1394 and libraw1394.
  520.  
  521.  
  522. =head2 openal
  523.  
  524.  
  525. The OpenAL input device provides audio capture on all systems with a
  526. working OpenAL 1.1 implementation.
  527.  
  528. To enable this input device during configuration, you need OpenAL
  529. headers and libraries installed on your system, and need to configure
  530. FFmpeg with C<--enable-openal>.
  531.  
  532. OpenAL headers and libraries should be provided as part of your OpenAL
  533. implementation, or as an additional download (an SDK). Depending on your
  534. installation you may need to specify additional flags via the
  535. C<--extra-cflags> and C<--extra-ldflags> for allowing the build
  536. system to locate the OpenAL headers and libraries.
  537.  
  538. An incomplete list of OpenAL implementations follows:
  539.  
  540.  
  541. =over 4
  542.  
  543.  
  544. =item B<Creative>
  545.  
  546. The official Windows implementation, providing hardware acceleration
  547. with supported devices and software fallback.
  548. See E<lt>B<http://openal.org/>E<gt>.
  549.  
  550. =item B<OpenAL Soft>
  551.  
  552. Portable, open source (LGPL) software implementation. Includes
  553. backends for the most common sound APIs on the Windows, Linux,
  554. Solaris, and BSD operating systems.
  555. See E<lt>B<http://kcat.strangesoft.net/openal.html>E<gt>.
  556.  
  557. =item B<Apple>
  558.  
  559. OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  560. See E<lt>B<http://developer.apple.com/technologies/mac/audio-and-video.html>E<gt>
  561.  
  562. =back
  563.  
  564.  
  565. This device allows to capture from an audio input device handled
  566. through OpenAL.
  567.  
  568. You need to specify the name of the device to capture in the provided
  569. filename. If the empty string is provided, the device will
  570. automatically select the default device. You can get the list of the
  571. supported devices by using the option I<list_devices>.
  572.  
  573.  
  574. =head3 Options
  575.  
  576.  
  577.  
  578. =over 4
  579.  
  580.  
  581.  
  582. =item B<channels>
  583.  
  584. Set the number of channels in the captured audio. Only the values
  585. B<1> (monaural) and B<2> (stereo) are currently supported.
  586. Defaults to B<2>.
  587.  
  588.  
  589. =item B<sample_size>
  590.  
  591. Set the sample size (in bits) of the captured audio. Only the values
  592. B<8> and B<16> are currently supported. Defaults to
  593. B<16>.
  594.  
  595.  
  596. =item B<sample_rate>
  597.  
  598. Set the sample rate (in Hz) of the captured audio.
  599. Defaults to B<44.1k>.
  600.  
  601.  
  602. =item B<list_devices>
  603.  
  604. If set to B<true>, print a list of devices and exit.
  605. Defaults to B<false>.
  606.  
  607.  
  608. =back
  609.  
  610.  
  611.  
  612. =head3 Examples
  613.  
  614.  
  615. Print the list of OpenAL supported devices and exit:
  616.        
  617.         $ ffmpeg -list_devices true -f openal -i dummy out.ogg
  618.  
  619.  
  620. Capture from the OpenAL device F<DR-BT101 via PulseAudio>:
  621.        
  622.         $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  623.  
  624.  
  625. Capture from the default device (note the empty string '' as filename):
  626.        
  627.         $ ffmpeg -f openal -i '' out.ogg
  628.  
  629.  
  630. Capture from two devices simultaneously, writing to two different files,
  631. within the same B<ffmpeg> command:
  632.        
  633.         $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  634.  
  635. Note: not all OpenAL implementations support multiple simultaneous capture -
  636. try the latest OpenAL Soft if the above does not work.
  637.  
  638.  
  639. =head2 oss
  640.  
  641.  
  642. Open Sound System input device.
  643.  
  644. The filename to provide to the input device is the device node
  645. representing the OSS input device, and is usually set to
  646. F</dev/dsp>.
  647.  
  648. For example to grab from F</dev/dsp> using B<ffmpeg> use the
  649. command:
  650.        
  651.         ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  652.  
  653.  
  654. For more information about OSS see:
  655. E<lt>B<http://manuals.opensound.com/usersguide/dsp.html>E<gt>
  656.  
  657.  
  658. =head2 pulse
  659.  
  660.  
  661. PulseAudio input device.
  662.  
  663. To enable this output device you need to configure FFmpeg with C<--enable-libpulse>.
  664.  
  665. The filename to provide to the input device is a source device or the
  666. string "default"
  667.  
  668. To list the PulseAudio source devices and their properties you can invoke
  669. the command B<pactl list sources>.
  670.  
  671. More information about PulseAudio can be found on E<lt>B<http://www.pulseaudio.org>E<gt>.
  672.  
  673.  
  674. =head3 Options
  675.  
  676.  
  677. =over 4
  678.  
  679.  
  680. =item B<server>
  681.  
  682. Connect to a specific PulseAudio server, specified by an IP address.
  683. Default server is used when not provided.
  684.  
  685.  
  686. =item B<name>
  687.  
  688. Specify the application name PulseAudio will use when showing active clients,
  689. by default it is the C<LIBAVFORMAT_IDENT> string.
  690.  
  691.  
  692. =item B<stream_name>
  693.  
  694. Specify the stream name PulseAudio will use when showing active streams,
  695. by default it is "record".
  696.  
  697.  
  698. =item B<sample_rate>
  699.  
  700. Specify the samplerate in Hz, by default 48kHz is used.
  701.  
  702.  
  703. =item B<channels>
  704.  
  705. Specify the channels in use, by default 2 (stereo) is set.
  706.  
  707.  
  708. =item B<frame_size>
  709.  
  710. Specify the number of bytes per frame, by default it is set to 1024.
  711.  
  712.  
  713. =item B<fragment_size>
  714.  
  715. Specify the minimal buffering fragment in PulseAudio, it will affect the
  716. audio latency. By default it is unset.
  717.  
  718. =back
  719.  
  720.  
  721.  
  722. =head3 Examples
  723.  
  724. Record a stream from default device:
  725.        
  726.         ffmpeg -f pulse -i default /tmp/pulse.wav
  727.  
  728.  
  729.  
  730. =head2 sndio
  731.  
  732.  
  733. sndio input device.
  734.  
  735. To enable this input device during configuration you need libsndio
  736. installed on your system.
  737.  
  738. The filename to provide to the input device is the device node
  739. representing the sndio input device, and is usually set to
  740. F</dev/audio0>.
  741.  
  742. For example to grab from F</dev/audio0> using B<ffmpeg> use the
  743. command:
  744.        
  745.         ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  746.  
  747.  
  748.  
  749. =head2 video4linux2, v4l2
  750.  
  751.  
  752. Video4Linux2 input video device.
  753.  
  754. "v4l2" can be used as alias for "video4linux2".
  755.  
  756. If FFmpeg is built with v4l-utils support (by using the
  757. C<--enable-libv4l2> configure option), it is possible to use it with the
  758. C<-use_libv4l2> input device option.
  759.  
  760. The name of the device to grab is a file device node, usually Linux
  761. systems tend to automatically create such nodes when the device
  762. (e.g. an USB webcam) is plugged into the system, and has a name of the
  763. kind F</dev/videoI<N>>, where I<N> is a number associated to
  764. the device.
  765.  
  766. Video4Linux2 devices usually support a limited set of
  767. I<width>xI<height> sizes and frame rates. You can check which are
  768. supported using B<-list_formats all> for Video4Linux2 devices.
  769. Some devices, like TV cards, support one or more standards. It is possible
  770. to list all the supported standards using B<-list_standards all>.
  771.  
  772. The time base for the timestamps is 1 microsecond. Depending on the kernel
  773. version and configuration, the timestamps may be derived from the real time
  774. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  775. boot time, unaffected by NTP or manual changes to the clock). The
  776. B<-timestamps abs> or B<-ts abs> option can be used to force
  777. conversion into the real time clock.
  778.  
  779. Some usage examples of the video4linux2 device with B<ffmpeg>
  780. and B<ffplay>:
  781.  
  782. =over 4
  783.  
  784.  
  785. =item *
  786.  
  787. Grab and show the input of a video4linux2 device:
  788.        
  789.         ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  790.  
  791.  
  792.  
  793. =item *
  794.  
  795. Grab and record the input of a video4linux2 device, leave the
  796. frame rate and size as previously set:
  797.        
  798.         ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  799.  
  800.  
  801. =back
  802.  
  803.  
  804. For more information about Video4Linux, check E<lt>B<http://linuxtv.org/>E<gt>.
  805.  
  806.  
  807. =head3 Options
  808.  
  809.  
  810.  
  811. =over 4
  812.  
  813.  
  814. =item B<standard>
  815.  
  816. Set the standard. Must be the name of a supported standard. To get a
  817. list of the supported standards, use the B<list_standards>
  818. option.
  819.  
  820.  
  821. =item B<channel>
  822.  
  823. Set the input channel number. Default to -1, which means using the
  824. previously selected channel.
  825.  
  826.  
  827. =item B<video_size>
  828.  
  829. Set the video frame size. The argument must be a string in the form
  830. I<WIDTH>xI<HEIGHT> or a valid size abbreviation.
  831.  
  832.  
  833. =item B<pixel_format>
  834.  
  835. Select the pixel format (only valid for raw video input).
  836.  
  837.  
  838. =item B<input_format>
  839.  
  840. Set the preferred pixel format (for raw video) or a codec name.
  841. This option allows to select the input format, when several are
  842. available.
  843.  
  844.  
  845. =item B<framerate>
  846.  
  847. Set the preferred video frame rate.
  848.  
  849.  
  850. =item B<list_formats>
  851.  
  852. List available formats (supported pixel formats, codecs, and frame
  853. sizes) and exit.
  854.  
  855. Available values are:
  856.  
  857. =over 4
  858.  
  859.  
  860. =item B<all>
  861.  
  862. Show all available (compressed and non-compressed) formats.
  863.  
  864.  
  865. =item B<raw>
  866.  
  867. Show only raw video (non-compressed) formats.
  868.  
  869.  
  870. =item B<compressed>
  871.  
  872. Show only compressed formats.
  873.  
  874. =back
  875.  
  876.  
  877.  
  878. =item B<list_standards>
  879.  
  880. List supported standards and exit.
  881.  
  882. Available values are:
  883.  
  884. =over 4
  885.  
  886.  
  887. =item B<all>
  888.  
  889. Show all supported standards.
  890.  
  891. =back
  892.  
  893.  
  894.  
  895. =item B<timestamps, ts>
  896.  
  897. Set type of timestamps for grabbed frames.
  898.  
  899. Available values are:
  900.  
  901. =over 4
  902.  
  903.  
  904. =item B<default>
  905.  
  906. Use timestamps from the kernel.
  907.  
  908.  
  909. =item B<abs>
  910.  
  911. Use absolute timestamps (wall clock).
  912.  
  913.  
  914. =item B<mono2abs>
  915.  
  916. Force conversion from monotonic to absolute timestamps.
  917.  
  918. =back
  919.  
  920.  
  921. Default value is C<default>.
  922.  
  923. =back
  924.  
  925.  
  926.  
  927. =head2 vfwcap
  928.  
  929.  
  930. VfW (Video for Windows) capture input device.
  931.  
  932. The filename passed as input is the capture driver number, ranging from
  933. 0 to 9. You may use "list" as filename to print a list of drivers. Any
  934. other filename will be interpreted as device number 0.
  935.  
  936.  
  937. =head2 x11grab
  938.  
  939.  
  940. X11 video input device.
  941.  
  942. This device allows to capture a region of an X11 display.
  943.  
  944. The filename passed as input has the syntax:
  945.        
  946.         [<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
  947.  
  948.  
  949. I<hostname>:I<display_number>.I<screen_number> specifies the
  950. X11 display name of the screen to grab from. I<hostname> can be
  951. omitted, and defaults to "localhost". The environment variable
  952. B<DISPLAY> contains the default display name.
  953.  
  954. I<x_offset> and I<y_offset> specify the offsets of the grabbed
  955. area with respect to the top-left border of the X11 screen. They
  956. default to 0.
  957.  
  958. Check the X11 documentation (e.g. man X) for more detailed information.
  959.  
  960. Use the B<dpyinfo> program for getting basic information about the
  961. properties of your X11 display (e.g. grep for "name" or "dimensions").
  962.  
  963. For example to grab from F<:0.0> using B<ffmpeg>:
  964.        
  965.         ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  966.  
  967.  
  968. Grab at position C<10,20>:
  969.        
  970.         ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  971.  
  972.  
  973.  
  974. =head3 Options
  975.  
  976.  
  977.  
  978. =over 4
  979.  
  980.  
  981. =item B<draw_mouse>
  982.  
  983. Specify whether to draw the mouse pointer. A value of C<0> specify
  984. not to draw the pointer. Default value is C<1>.
  985.  
  986.  
  987. =item B<follow_mouse>
  988.  
  989. Make the grabbed area follow the mouse. The argument can be
  990. C<centered> or a number of pixels I<PIXELS>.
  991.  
  992. When it is specified with "centered", the grabbing region follows the mouse
  993. pointer and keeps the pointer at the center of region; otherwise, the region
  994. follows only when the mouse pointer reaches within I<PIXELS> (greater than
  995. zero) to the edge of region.
  996.  
  997. For example:
  998.        
  999.         ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  1000.  
  1001.  
  1002. To follow only when the mouse pointer reaches within 100 pixels to edge:
  1003.        
  1004.         ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  1005.  
  1006.  
  1007.  
  1008. =item B<framerate>
  1009.  
  1010. Set the grabbing frame rate. Default value is C<ntsc>,
  1011. corresponding to a frame rate of C<30000/1001>.
  1012.  
  1013.  
  1014. =item B<show_region>
  1015.  
  1016. Show grabbed region on screen.
  1017.  
  1018. If I<show_region> is specified with C<1>, then the grabbing
  1019. region will be indicated on screen. With this option, it is easy to
  1020. know what is being grabbed if only a portion of the screen is grabbed.
  1021.  
  1022. For example:
  1023.        
  1024.         ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  1025.  
  1026.  
  1027. With I<follow_mouse>:
  1028.        
  1029.         ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  1030.  
  1031.  
  1032.  
  1033. =item B<video_size>
  1034.  
  1035. Set the video frame size. Default value is C<vga>.
  1036.  
  1037. =back
  1038.  
  1039.  
  1040.  
  1041. =head1 OUTPUT DEVICES
  1042.  
  1043.  
  1044. Output devices are configured elements in FFmpeg that can write
  1045. multimedia data to an output device attached to your system.
  1046.  
  1047. When you configure your FFmpeg build, all the supported output devices
  1048. are enabled by default. You can list all available ones using the
  1049. configure option "--list-outdevs".
  1050.  
  1051. You can disable all the output devices using the configure option
  1052. "--disable-outdevs", and selectively enable an output device using the
  1053. option "--enable-outdev=I<OUTDEV>", or you can disable a particular
  1054. input device using the option "--disable-outdev=I<OUTDEV>".
  1055.  
  1056. The option "-formats" of the ff* tools will display the list of
  1057. enabled output devices (amongst the muxers).
  1058.  
  1059. A description of the currently available output devices follows.
  1060.  
  1061.  
  1062. =head2 alsa
  1063.  
  1064.  
  1065. ALSA (Advanced Linux Sound Architecture) output device.
  1066.  
  1067.  
  1068. =head2 caca
  1069.  
  1070.  
  1071. CACA output device.
  1072.  
  1073. This output device allows to show a video stream in CACA window.
  1074. Only one CACA window is allowed per application, so you can
  1075. have only one instance of this output device in an application.
  1076.  
  1077. To enable this output device you need to configure FFmpeg with
  1078. C<--enable-libcaca>.
  1079. libcaca is a graphics library that outputs text instead of pixels.
  1080.  
  1081. For more information about libcaca, check:
  1082. E<lt>B<http://caca.zoy.org/wiki/libcaca>E<gt>
  1083.  
  1084.  
  1085. =head3 Options
  1086.  
  1087.  
  1088.  
  1089. =over 4
  1090.  
  1091.  
  1092.  
  1093. =item B<window_title>
  1094.  
  1095. Set the CACA window title, if not specified default to the filename
  1096. specified for the output device.
  1097.  
  1098.  
  1099. =item B<window_size>
  1100.  
  1101. Set the CACA window size, can be a string of the form
  1102. I<width>xI<height> or a video size abbreviation.
  1103. If not specified it defaults to the size of the input video.
  1104.  
  1105.  
  1106. =item B<driver>
  1107.  
  1108. Set display driver.
  1109.  
  1110.  
  1111. =item B<algorithm>
  1112.  
  1113. Set dithering algorithm. Dithering is necessary
  1114. because the picture being rendered has usually far more colours than
  1115. the available palette.
  1116. The accepted values are listed with C<-list_dither algorithms>.
  1117.  
  1118.  
  1119. =item B<antialias>
  1120.  
  1121. Set antialias method. Antialiasing smoothens the rendered
  1122. image and avoids the commonly seen staircase effect.
  1123. The accepted values are listed with C<-list_dither antialiases>.
  1124.  
  1125.  
  1126. =item B<charset>
  1127.  
  1128. Set which characters are going to be used when rendering text.
  1129. The accepted values are listed with C<-list_dither charsets>.
  1130.  
  1131.  
  1132. =item B<color>
  1133.  
  1134. Set color to be used when rendering text.
  1135. The accepted values are listed with C<-list_dither colors>.
  1136.  
  1137.  
  1138. =item B<list_drivers>
  1139.  
  1140. If set to B<true>, print a list of available drivers and exit.
  1141.  
  1142.  
  1143. =item B<list_dither>
  1144.  
  1145. List available dither options related to the argument.
  1146. The argument must be one of C<algorithms>, C<antialiases>,
  1147. C<charsets>, C<colors>.
  1148.  
  1149. =back
  1150.  
  1151.  
  1152.  
  1153. =head3 Examples
  1154.  
  1155.  
  1156.  
  1157. =over 4
  1158.  
  1159.  
  1160. =item *
  1161.  
  1162. The following command shows the B<ffmpeg> output is an
  1163. CACA window, forcing its size to 80x25:
  1164.        
  1165.         ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  1166.  
  1167.  
  1168.  
  1169. =item *
  1170.  
  1171. Show the list of available drivers and exit:
  1172.        
  1173.         ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  1174.  
  1175.  
  1176.  
  1177. =item *
  1178.  
  1179. Show the list of available dither colors and exit:
  1180.        
  1181.         ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  1182.  
  1183.  
  1184. =back
  1185.  
  1186.  
  1187.  
  1188. =head2 fbdev
  1189.  
  1190.  
  1191. Linux framebuffer output device.
  1192.  
  1193. The Linux framebuffer is a graphic hardware-independent abstraction
  1194. layer to show graphics on a computer monitor, typically on the
  1195. console. It is accessed through a file device node, usually
  1196. F</dev/fb0>.
  1197.  
  1198. For more detailed information read the file
  1199. F<Documentation/fb/framebuffer.txt> included in the Linux source tree.
  1200.  
  1201.  
  1202. =head3 Options
  1203.  
  1204.  
  1205. =over 4
  1206.  
  1207.  
  1208.  
  1209. =item B<xoffset>
  1210.  
  1211.  
  1212. =item B<yoffset>
  1213.  
  1214. Set x/y coordinate of top left corner. Default is 0.
  1215.  
  1216. =back
  1217.  
  1218.  
  1219.  
  1220. =head3 Examples
  1221.  
  1222. Play a file on framebuffer device F</dev/fb0>.
  1223. Required pixel format depends on current framebuffer settings.
  1224.        
  1225.         ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  1226.  
  1227.  
  1228. See also E<lt>B<http://linux-fbdev.sourceforge.net/>E<gt>, and fbset(1).
  1229.  
  1230.  
  1231. =head2 oss
  1232.  
  1233.  
  1234. OSS (Open Sound System) output device.
  1235.  
  1236.  
  1237. =head2 pulse
  1238.  
  1239.  
  1240. PulseAudio output device.
  1241.  
  1242. To enable this output device you need to configure FFmpeg with C<--enable-libpulse>.
  1243.  
  1244. More information about PulseAudio can be found on E<lt>B<http://www.pulseaudio.org>E<gt>
  1245.  
  1246.  
  1247. =head3 Options
  1248.  
  1249.  
  1250. =over 4
  1251.  
  1252.  
  1253.  
  1254. =item B<server>
  1255.  
  1256. Connect to a specific PulseAudio server, specified by an IP address.
  1257. Default server is used when not provided.
  1258.  
  1259.  
  1260. =item B<name>
  1261.  
  1262. Specify the application name PulseAudio will use when showing active clients,
  1263. by default it is the C<LIBAVFORMAT_IDENT> string.
  1264.  
  1265.  
  1266. =item B<stream_name>
  1267.  
  1268. Specify the stream name PulseAudio will use when showing active streams,
  1269. by default it is set to the specified output name.
  1270.  
  1271.  
  1272. =item B<device>
  1273.  
  1274. Specify the device to use. Default device is used when not provided.
  1275. List of output devices can be obtained with command B<pactl list sinks>.
  1276.  
  1277.  
  1278. =back
  1279.  
  1280.  
  1281.  
  1282. =head3 Examples
  1283.  
  1284. Play a file on default device on default server:
  1285.        
  1286.         ffmpeg  -i INPUT -f pulse "stream name"
  1287.  
  1288.  
  1289.  
  1290. =head2 sdl
  1291.  
  1292.  
  1293. SDL (Simple DirectMedia Layer) output device.
  1294.  
  1295. This output device allows to show a video stream in an SDL
  1296. window. Only one SDL window is allowed per application, so you can
  1297. have only one instance of this output device in an application.
  1298.  
  1299. To enable this output device you need libsdl installed on your system
  1300. when configuring your build.
  1301.  
  1302. For more information about SDL, check:
  1303. E<lt>B<http://www.libsdl.org/>E<gt>
  1304.  
  1305.  
  1306. =head3 Options
  1307.  
  1308.  
  1309.  
  1310. =over 4
  1311.  
  1312.  
  1313.  
  1314. =item B<window_title>
  1315.  
  1316. Set the SDL window title, if not specified default to the filename
  1317. specified for the output device.
  1318.  
  1319.  
  1320. =item B<icon_title>
  1321.  
  1322. Set the name of the iconified SDL window, if not specified it is set
  1323. to the same value of I<window_title>.
  1324.  
  1325.  
  1326. =item B<window_size>
  1327.  
  1328. Set the SDL window size, can be a string of the form
  1329. I<width>xI<height> or a video size abbreviation.
  1330. If not specified it defaults to the size of the input video,
  1331. downscaled according to the aspect ratio.
  1332.  
  1333.  
  1334. =item B<window_fullscreen>
  1335.  
  1336. Set fullscreen mode when non-zero value is provided.
  1337. Zero is a default.
  1338.  
  1339. =back
  1340.  
  1341.  
  1342.  
  1343. =head3 Examples
  1344.  
  1345.  
  1346. The following command shows the B<ffmpeg> output is an
  1347. SDL window, forcing its size to the qcif format:
  1348.        
  1349.         ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
  1350.  
  1351.  
  1352.  
  1353. =head2 sndio
  1354.  
  1355.  
  1356. sndio audio output device.
  1357.  
  1358.  
  1359. =head2 xv
  1360.  
  1361.  
  1362. XV (XVideo) output device.
  1363.  
  1364. This output device allows to show a video stream in a X Window System
  1365. window.
  1366.  
  1367.  
  1368. =head3 Options
  1369.  
  1370.  
  1371.  
  1372. =over 4
  1373.  
  1374.  
  1375. =item B<display_name>
  1376.  
  1377. Specify the hardware display name, which determines the display and
  1378. communications domain to be used.
  1379.  
  1380. The display name or DISPLAY environment variable can be a string in
  1381. the format I<hostname>[:I<number>[.I<screen_number>]].
  1382.  
  1383. I<hostname> specifies the name of the host machine on which the
  1384. display is physically attached. I<number> specifies the number of
  1385. the display server on that host machine. I<screen_number> specifies
  1386. the screen to be used on that server.
  1387.  
  1388. If unspecified, it defaults to the value of the DISPLAY environment
  1389. variable.
  1390.  
  1391. For example, C<dual-headed:0.1> would specify screen 1 of display
  1392. 0 on the machine named ``dual-headed''.
  1393.  
  1394. Check the X11 specification for more detailed information about the
  1395. display name format.
  1396.  
  1397.  
  1398. =item B<window_size>
  1399.  
  1400. Set the created window size, can be a string of the form
  1401. I<width>xI<height> or a video size abbreviation. If not
  1402. specified it defaults to the size of the input video.
  1403.  
  1404.  
  1405. =item B<window_x>
  1406.  
  1407.  
  1408. =item B<window_y>
  1409.  
  1410. Set the X and Y window offsets for the created window. They are both
  1411. set to 0 by default. The values may be ignored by the window manager.
  1412.  
  1413.  
  1414. =item B<window_title>
  1415.  
  1416. Set the window title, if not specified default to the filename
  1417. specified for the output device.
  1418.  
  1419. =back
  1420.  
  1421.  
  1422. For more information about XVideo see E<lt>B<http://www.x.org/>E<gt>.
  1423.  
  1424.  
  1425. =head3 Examples
  1426.  
  1427.  
  1428.  
  1429. =over 4
  1430.  
  1431.  
  1432. =item *
  1433.  
  1434. Decode, display and encode video input with B<ffmpeg> at the
  1435. same time:
  1436.        
  1437.         ffmpeg -i INPUT OUTPUT -f xv display
  1438.  
  1439.  
  1440.  
  1441. =item *
  1442.  
  1443. Decode and display the input video to multiple X11 windows:
  1444.        
  1445.         ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  1446.  
  1447.  
  1448. =back
  1449.  
  1450.  
  1451.  
  1452.  
  1453. =head1 SEE ALSO
  1454.  
  1455.  
  1456.  
  1457. ffmpeg(1), ffplay(1), ffprobe(1), ffserver(1), libavdevice(3)
  1458.  
  1459.  
  1460. =head1 AUTHORS
  1461.  
  1462.  
  1463. The FFmpeg developers.
  1464.  
  1465. For details about the authorship, see the Git history of the project
  1466. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  1467. B<git log> in the FFmpeg source directory, or browsing the
  1468. online repository at E<lt>B<http://source.ffmpeg.org>E<gt>.
  1469.  
  1470. Maintainers for the specific components are listed in the file
  1471. F<MAINTAINERS> in the source code tree.
  1472.  
  1473.  
  1474.  
  1475.