diff options
Diffstat (limited to 'doc/protocols.texi')
-rw-r--r-- | doc/protocols.texi | 663 |
1 files changed, 574 insertions, 89 deletions
diff --git a/doc/protocols.texi b/doc/protocols.texi index 4957aff..2a19b41 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1,10 +1,10 @@ @chapter Protocols @c man begin PROTOCOLS -Protocols are configured elements in Libav which allow to access -resources which require the use of a particular protocol. +Protocols are configured elements in FFmpeg that enable access to +resources that require specific protocols. -When you configure your Libav build, all the supported protocols are +When you configure your FFmpeg build, all the supported protocols are enabled by default. You can list all available ones using the configure option "--list-protocols". @@ -14,16 +14,56 @@ option "--enable-protocol=@var{PROTOCOL}", or you can disable a particular protocol using the option "--disable-protocol=@var{PROTOCOL}". -The option "-protocols" of the av* tools will display the list of +The option "-protocols" of the ff* tools will display the list of supported protocols. A description of the currently available protocols follows. +@section bluray + +Read BluRay playlist. + +The accepted options are: +@table @option + +@item angle +BluRay angle + +@item chapter +Start chapter (1...N) + +@item playlist +Playlist to read (BDMV/PLAYLIST/?????.mpls) + +@end table + +Examples: + +Read longest playlist from BluRay mounted to /mnt/bluray: +@example +bluray:/mnt/bluray +@end example + +Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: +@example +-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray +@end example + +@section cache + +Caching wrapper for input stream. + +Cache the input stream to temporary file. It brings seeking capability to live streams. + +@example +cache:@var{URL} +@end example + @section concat Physical concatenation protocol. -Allow to read and seek from many resource in sequence as if they were +Read and seek from many resources in sequence as if they were a unique resource. A URL accepted by this protocol has the syntax: @@ -36,30 +76,114 @@ resource to be concatenated, each one possibly specifying a distinct protocol. For example to read a sequence of files @file{split1.mpeg}, -@file{split2.mpeg}, @file{split3.mpeg} with @command{avplay} use the +@file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use the command: @example -avplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg +ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg @end example Note that you may need to escape the character "|" which is special for many shells. +@section crypto + +AES-encrypted stream reading protocol. + +The accepted options are: +@table @option +@item key +Set the AES decryption key binary block from given hexadecimal representation. + +@item iv +Set the AES decryption initialization vector binary block from given hexadecimal representation. +@end table + +Accepted URL formats: +@example +crypto:@var{URL} +crypto+@var{URL} +@end example + +@section data + +Data in-line in the URI. See @url{http://en.wikipedia.org/wiki/Data_URI_scheme}. + +For example, to convert a GIF file given inline with @command{ffmpeg}: +@example +ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png +@end example + @section file File access protocol. -Allow to read from or read to a file. +Read from or write to a file. + +A file URL can have the form: +@example +file:@var{filename} +@end example + +where @var{filename} is the path of the file to read. + +An URL that does not have a protocol prefix will be assumed to be a +file URL. Depending on the build, an URL that looks like a Windows +path with the drive letter at the beginning will also be assumed to be +a file URL (usually not the case in builds for unix-like systems). -For example to read from a file @file{input.mpeg} with @command{avconv} +For example to read from a file @file{input.mpeg} with @command{ffmpeg} use the command: @example -avconv -i file:input.mpeg output.mpeg +ffmpeg -i file:input.mpeg output.mpeg @end example -The av* tools default to the file protocol, that is a resource -specified with the name "FILE.mpeg" is interpreted as the URL -"file:FILE.mpeg". +This protocol accepts the following options: + +@table @option +@item truncate +Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. + +@item blocksize +Set I/O operation maximum block size, in bytes. Default value is +@code{INT_MAX}, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable for files on slow medium. +@end table + +@section ftp + +FTP (File Transfer Protocol). + +Read from or write to remote resources using FTP protocol. + +Following syntax is required. +@example +ftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg +@end example + +This protocol accepts the following options. + +@table @option +@item timeout +Set timeout in microseconds of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout is +not specified. + +@item ftp-anonymous-password +Password used when login as anonymous user. Typically an e-mail address +should be used. + +@item ftp-write-seekable +Control seekability of connection during encoding. If set to 1 the +resource is supposed to be seekable, if set to 0 it is assumed not +to be seekable. Default value is 0. +@end table + +NOTE: Protocol can be used as output, but it is recommended to not do +it, unless special care is taken (tests, customized server configuration +etc.). Different FTP servers behave in different way during seek +operation. ff* tools may produce incomplete content due to server limitations. @section gopher @@ -92,6 +216,12 @@ HTTP (Hyper Text Transfer Protocol). This protocol accepts the following options: @table @option +@item seekable +Control seekability of connection. If set to 1 the resource is +supposed to be seekable, if set to 0 it is assumed not to be seekable, +if set to -1 it will try to autodetect if it is seekable. Default +value is -1. + @item chunked_post If set to 1 use chunked Transfer-Encoding for posts, default is 1. @@ -108,9 +238,15 @@ Use persistent connections if set to 1, default is 0. @item post_data Set custom HTTP post data. +@item user-agent @item user_agent -Override the User-Agent header. If not specified a string of the form -"Lavf/<version>" will be used. +Override the User-Agent header. If not specified the protocol will use a +string describing the libavformat build. ("Lavf/<version>") + +@item timeout +Set timeout in microseconds of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout is +not specified. @item mime_type Export the MIME type. @@ -131,6 +267,11 @@ contains the last non-empty metadata packet sent by the server. It should be polled in regular intervals by applications interested in mid-stream metadata updates. +@item cookies +Set the cookies to be sent in future requests. The format of each cookie is the +same as the value of a Set-Cookie HTTP response field. Multiple cookies can be +delimited by a newline character. + @item offset Set initial byte offset. @@ -138,9 +279,23 @@ Set initial byte offset. Try to limit the request to bytes preceding this offset. @end table +@subsection HTTP Cookies + +Some HTTP requests will be denied unless cookie values are passed in with the +request. The @option{cookies} option allows these cookies to be specified. At +the very least, each cookie must specify a value along with a path and domain. +HTTP requests that match both the domain and path will automatically include the +cookie value in the HTTP Cookie header field. Multiple cookies can be delimited +by a newline. + +The required syntax to play a stream specifying a cookie is: +@example +ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8 +@end example + @section Icecast -Icecast (stream to Icecast servers) +Icecast protocol (stream to Icecast servers) This protocol accepts the following options: @@ -158,7 +313,7 @@ Set the stream description. Set the stream website URL. @item ice_public -Set if the stream should be public or not. +Set if the stream should be public. The default is 0 (not public). @item user_agent @@ -178,6 +333,10 @@ HTTP PUT method but the SOURCE method. @end table +@example +icecast://[@var{username}[:@var{password}]@@]@var{server}:@var{port}/@var{mountpoint} +@end example + @section mmst MMS (Microsoft Media Server) protocol over TCP. @@ -202,10 +361,10 @@ be used to test muxers without writing an actual file. Some examples follow. @example # Write the MD5 hash of the encoded AVI file to the file output.avi.md5. -avconv -i input.flv -f avi -y md5:output.avi.md5 +ffmpeg -i input.flv -f avi -y md5:output.avi.md5 # Write the MD5 hash of the encoded AVI file to stdout. -avconv -i input.flv -f avi -y md5: +ffmpeg -i input.flv -f avi -y md5: @end example Note that some formats (typically MOV) require the output protocol to @@ -215,7 +374,7 @@ be seekable, so they will fail with the MD5 output protocol. UNIX pipe access protocol. -Allow to read and write from UNIX pipes. +Read and write from UNIX pipes. The accepted syntax is: @example @@ -227,20 +386,30 @@ pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number} is not specified, by default the stdout file descriptor will be used for writing, stdin for reading. -For example to read from stdin with @command{avconv}: +For example to read from stdin with @command{ffmpeg}: @example -cat test.wav | avconv -i pipe:0 +cat test.wav | ffmpeg -i pipe:0 # ...this is the same as... -cat test.wav | avconv -i pipe: +cat test.wav | ffmpeg -i pipe: @end example -For writing to stdout with @command{avconv}: +For writing to stdout with @command{ffmpeg}: @example -avconv -i test.wav -f avi pipe:1 | cat > test.avi +ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi # ...this is the same as... -avconv -i test.wav -f avi pipe: | cat > test.avi +ffmpeg -i test.wav -f avi pipe: | cat > test.avi @end example +This protocol accepts the following options: + +@table @option +@item blocksize +Set I/O operation maximum block size, in bytes. Default value is +@code{INT_MAX}, which results in not limiting the requested block size. +Setting this value reasonably low improves user termination request reaction +time, which is valuable if data transmission is slow. +@end table + Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol. @@ -360,16 +529,16 @@ URL of the target stream. Defaults to proto://host[:port]/app. @end table -For example to read with @command{avplay} a multimedia resource named +For example to read with @command{ffplay} a multimedia resource named "sample" from the application "vod" from an RTMP server "myserver": @example -avplay rtmp://myserver/vod/sample +ffplay rtmp://myserver/vod/sample @end example To publish to a password protected server, passing the playpath and app names separately: @example -avconv -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@@myserver/ +ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@@myserver/ @end example @section rtmpe @@ -412,6 +581,71 @@ The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used for streaming multimedia content within HTTPS requests to traverse firewalls. +@section libsmbclient + +libsmbclient permits one to manipulate CIFS/SMB network resources. + +Following syntax is required. + +@example +smb://[[domain:]user[:password@@]]server[/share[/path[/file]]] +@end example + +This protocol accepts the following options. + +@table @option +@item timeout +Set timeout in miliseconds of socket I/O operations used by the underlying +low level operation. By default it is set to -1, which means that the timeout +is not specified. + +@item truncate +Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. + +@item workgroup +Set the workgroup used for making connections. By default workgroup is not specified. + +@end table + +For more information see: @url{http://www.samba.org/}. + +@section libssh + +Secure File Transfer Protocol via libssh + +Read from or write to remote resources using SFTP protocol. + +Following syntax is required. + +@example +sftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg +@end example + +This protocol accepts the following options. + +@table @option +@item timeout +Set timeout of socket I/O operations used by the underlying low level +operation. By default it is set to -1, which means that the timeout +is not specified. + +@item truncate +Truncate existing files on write, if set to 1. A value of 0 prevents +truncating. Default value is 1. + +@item private_key +Specify the path of the file containing private key to use during authorization. +By default libssh searches for keys in the @file{~/.ssh/} directory. + +@end table + +Example: Play a file stored on remote server. + +@example +ffplay sftp://user:password@@server_address:22/home/user/resource.mpeg +@end example + @section librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte Real-Time Messaging Protocol and its variants supported through @@ -442,22 +676,87 @@ meaning as specified for the RTMP native protocol. See the librtmp manual page (man 3 librtmp) for more information. For example, to stream a file in real-time to an RTMP server using -@command{avconv}: +@command{ffmpeg}: @example -avconv -re -i myfile -f flv rtmp://myserver/live/mystream +ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream @end example -To play the same stream using @command{avplay}: +To play the same stream using @command{ffplay}: @example -avplay "rtmp://myserver/live/mystream live=1" +ffplay "rtmp://myserver/live/mystream live=1" @end example @section rtp -Real-Time Protocol. +Real-time Transport Protocol. + +The required syntax for an RTP URL is: +rtp://@var{hostname}[:@var{port}][?@var{option}=@var{val}...] + +@var{port} specifies the RTP port to use. + +The following URL options are supported: + +@table @option + +@item ttl=@var{n} +Set the TTL (Time-To-Live) value (for multicast only). + +@item rtcpport=@var{n} +Set the remote RTCP port to @var{n}. + +@item localrtpport=@var{n} +Set the local RTP port to @var{n}. + +@item localrtcpport=@var{n}' +Set the local RTCP port to @var{n}. + +@item pkt_size=@var{n} +Set max packet size (in bytes) to @var{n}. + +@item connect=0|1 +Do a @code{connect()} on the UDP socket (if set to 1) or not (if set +to 0). + +@item sources=@var{ip}[,@var{ip}] +List allowed source IP addresses. + +@item block=@var{ip}[,@var{ip}] +List disallowed (blocked) source IP addresses. + +@item write_to_source=0|1 +Send packets to the source address of the latest received packet (if +set to 1) or to a default remote address (if set to 0). + +@item localport=@var{n} +Set the local RTP port to @var{n}. + +This is a deprecated option. Instead, @option{localrtpport} should be +used. + +@end table + +Important notes: + +@enumerate + +@item +If @option{rtcpport} is not set the RTCP port will be set to the RTP +port value plus 1. + +@item +If @option{localrtpport} (the local RTP port) is not set any available +port will be used for the local RTP and RTCP ports. + +@item +If @option{localrtcpport} (the local RTCP port) is not set it will be +set to the local RTP port value plus 1. +@end enumerate @section rtsp +Real-Time Streaming Protocol. + RTSP is not technically a protocol handler in libavformat, it is a demuxer and muxer. The demuxer supports both normal RTSP (with data transferred over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with @@ -465,21 +764,29 @@ data transferred over RDT). The muxer can be used to send a stream using RTSP ANNOUNCE to a server supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's -@uref{http://github.com/revmischa/rtsp-server, RTSP server}). +@uref{https://github.com/revmischa/rtsp-server, RTSP server}). The required syntax for a RTSP url is: @example rtsp://@var{hostname}[:@var{port}]/@var{path} @end example -The following options (set on the @command{avconv}/@command{avplay} command -line, or set in code via @code{AVOption}s or in @code{avformat_open_input}), -are supported: +Options can be set on the @command{ffmpeg}/@command{ffplay} command +line, or set in code via @code{AVOption}s or in +@code{avformat_open_input}. -Flags for @code{rtsp_transport}: +The following options are supported. @table @option +@item initial_pause +Do not start playing the stream immediately if set to 1. Default value +is 0. + +@item rtsp_transport +Set RTSP transport protocols. +It accepts the following values: +@table @samp @item udp Use UDP as lower transport protocol. @@ -497,15 +804,56 @@ passing proxies. Multiple lower transport protocols may be specified, in that case they are tried one at a time (if the setup of one fails, the next one is tried). -For the muxer, only the @code{tcp} and @code{udp} options are supported. +For the muxer, only the @samp{tcp} and @samp{udp} options are supported. -Flags for @code{rtsp_flags}: +@item rtsp_flags +Set RTSP flags. -@table @option +The following values are accepted: +@table @samp @item filter_src Accept packets only from negotiated peer address and port. @item listen Act as a server, listening for an incoming connection. +@item prefer_tcp +Try TCP for RTP transport first, if TCP is available as RTSP RTP transport. +@end table + +Default value is @samp{none}. + +@item allowed_media_types +Set media types to accept from the server. + +The following flags are accepted: +@table @samp +@item video +@item audio +@item data +@end table + +By default it accepts all media types. + +@item min_port +Set minimum local UDP port. Default value is 5000. + +@item max_port +Set maximum local UDP port. Default value is 65000. + +@item timeout +Set maximum timeout (in seconds) to wait for incoming connections. + +A value of -1 means infinite (default). This option implies the +@option{rtsp_flags} set to @samp{listen}. + +@item reorder_queue_size +Set number of packets to buffer for handling of reordered packets. + +@item stimeout +Set socket TCP I/O timeout in microseconds. + +@item user-agent +Override User-Agent header. If not specified, it defaults to the +libavformat identifier string. @end table When receiving data over UDP, the demuxer tries to reorder received packets @@ -513,36 +861,41 @@ When receiving data over UDP, the demuxer tries to reorder received packets can be disabled by setting the maximum demuxing delay to zero (via the @code{max_delay} field of AVFormatContext). -When watching multi-bitrate Real-RTSP streams with @command{avplay}, the +When watching multi-bitrate Real-RTSP streams with @command{ffplay}, the streams to display can be chosen with @code{-vst} @var{n} and @code{-ast} @var{n} for video and audio respectively, and can be switched on the fly by pressing @code{v} and @code{a}. -Example command lines: +@subsection Examples -To watch a stream over UDP, with a max reordering delay of 0.5 seconds: +The following examples all make use of the @command{ffplay} and +@command{ffmpeg} tools. +@itemize +@item +Watch a stream over UDP, with a max reordering delay of 0.5 seconds: @example -avplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4 +ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4 @end example -To watch a stream tunneled over HTTP: - +@item +Watch a stream tunneled over HTTP: @example -avplay -rtsp_transport http rtsp://server/video.mp4 +ffplay -rtsp_transport http rtsp://server/video.mp4 @end example -To send a stream in realtime to a RTSP server, for others to watch: - +@item +Send a stream in realtime to a RTSP server, for others to watch: @example -avconv -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp +ffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp @end example -To receive a stream in realtime: - +@item +Receive a stream in realtime: @example -avconv -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output} +ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output} @end example +@end itemize @section sap @@ -593,19 +946,19 @@ Example command lines follow. To broadcast a stream on the local subnet, for watching in VLC: @example -avconv -re -i @var{input} -f sap sap://224.0.0.255?same_port=1 +ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1 @end example -Similarly, for watching in avplay: +Similarly, for watching in @command{ffplay}: @example -avconv -re -i @var{input} -f sap sap://224.0.0.255 +ffmpeg -re -i @var{input} -f sap sap://224.0.0.255 @end example -And for watching in avplay, over IPv6: +And for watching in @command{ffplay}, over IPv6: @example -avconv -re -i @var{input} -f sap sap://[ff0e::1:2:3:4] +ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4] @end example @subsection Demuxer @@ -627,43 +980,127 @@ Example command lines follow. To play back the first stream announced on the normal SAP multicast address: @example -avplay sap:// +ffplay sap:// @end example To play back the first stream announced on one the default IPv6 SAP multicast address: @example -avplay sap://[ff0e::2:7ffe] +ffplay sap://[ff0e::2:7ffe] +@end example + +@section sctp + +Stream Control Transmission Protocol. + +The accepted URL syntax is: +@example +sctp://@var{host}:@var{port}[?@var{options}] +@end example + +The protocol accepts the following options: +@table @option +@item listen +If set to any value, listen for an incoming connection. Outgoing connection is done by default. + +@item max_streams +Set the maximum number of streams. By default no limit is set. +@end table + +@section srtp + +Secure Real-time Transport Protocol. + +The accepted options are: +@table @option +@item srtp_in_suite +@item srtp_out_suite +Select input and output encoding suites. + +Supported values: +@table @samp +@item AES_CM_128_HMAC_SHA1_80 +@item SRTP_AES128_CM_HMAC_SHA1_80 +@item AES_CM_128_HMAC_SHA1_32 +@item SRTP_AES128_CM_HMAC_SHA1_32 +@end table + +@item srtp_in_params +@item srtp_out_params +Set input and output encoding parameters, which are expressed by a +base64-encoded representation of a binary block. The first 16 bytes of +this binary block are used as master key, the following 14 bytes are +used as master salt. +@end table + +@section subfile + +Virtually extract a segment of a file or another stream. +The underlying stream must be seekable. + +Accepted options: +@table @option +@item start +Start offset of the extracted segment, in bytes. +@item end +End offset of the extracted segment, in bytes. +@end table + +Examples: + +Extract a chapter from a DVD VOB file (start and end sectors obtained +externally and multiplied by 2048): +@example +subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB +@end example + +Play an AVI file directly from a TAR archive: +@example +subfile,,start,183241728,end,366490624,,:archive.tar @end example @section tcp -Trasmission Control Protocol. +Transmission Control Protocol. The required syntax for a TCP url is: @example tcp://@var{hostname}:@var{port}[?@var{options}] @end example +@var{options} contains a list of &-separated options of the form +@var{key}=@var{val}. + +The list of supported options follows. + @table @option +@item listen=@var{1|0} +Listen for an incoming connection. Default value is 0. -@item listen -Listen for an incoming connection +@item timeout=@var{microseconds} +Set raise error timeout, expressed in microseconds. -@example -avconv -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen -avplay tcp://@var{hostname}:@var{port} -@end example +This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. +@item listen_timeout=@var{milliseconds} +Set listen timeout, expressed in milliseconds. @end table +The following example shows how to setup a listening TCP connection +with @command{ffmpeg}, which is then accessed with @command{ffplay}: +@example +ffmpeg -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen +ffplay tcp://@var{hostname}:@var{port} +@end example + @section tls Transport Layer Security (TLS) / Secure Sockets Layer (SSL) -The required syntax for a TLS url is: +The required syntax for a TLS/SSL url is: @example -tls://@var{hostname}:@var{port} +tls://@var{hostname}:@var{port}[?@var{options}] @end example The following parameters can be set via command line options @@ -671,11 +1108,12 @@ The following parameters can be set via command line options @table @option -@item ca_file +@item ca_file, cafile=@var{filename} A file containing certificate authority (CA) root certificates to treat as trusted. If the linked TLS library contains a default this might not need to be specified for verification to work, but not all libraries and setups have defaults built in. +The file must be in OpenSSL PEM format. @item tls_verify=@var{1|0} If enabled, try to verify the peer that we are communicating with. @@ -688,13 +1126,13 @@ the host name is validated as well.) This is disabled by default since it requires a CA database to be provided by the caller in many cases. -@item cert_file +@item cert_file, cert=@var{filename} A file containing a certificate to use in the handshake with the peer. (When operating as server, in listen mode, this is more often required by the peer, while client certificates only are mandated in certain setups.) -@item key_file +@item key_file, key=@var{filename} A file containing the private key for the certificate. @item listen=@var{1|0} @@ -703,25 +1141,46 @@ the server role in the handshake instead of the client role. @end table +Example command lines: + +To create a TLS/SSL server that serves an input stream. + +@example +ffmpeg -i @var{input} -f @var{format} tls://@var{hostname}:@var{port}?listen&cert=@var{server.crt}&key=@var{server.key} +@end example + +To play back a stream from the TLS/SSL server using @command{ffplay}: + +@example +ffplay tls://@var{hostname}:@var{port} +@end example + @section udp User Datagram Protocol. -The required syntax for a UDP url is: +The required syntax for an UDP URL is: @example udp://@var{hostname}:@var{port}[?@var{options}] @end example @var{options} contains a list of &-separated options of the form @var{key}=@var{val}. -Follow the list of supported options. -@table @option +In case threading is enabled on the system, a circular buffer is used +to store the incoming data, which allows one to reduce loss of data due to +UDP socket buffer overruns. The @var{fifo_size} and +@var{overrun_nonfatal} options are related to this buffer. + +The list of supported options follows. +@table @option @item buffer_size=@var{size} -set the UDP buffer size in bytes +Set the UDP maximum socket buffer size in bytes. This is used to set either +the receive or send buffer size, depending on what the socket is used for. +Default is 64KB. See also @var{fifo_size}. @item localport=@var{port} -override the local UDP port to bind with +Override the local UDP port to bind with. @item localaddr=@var{addr} Choose the local IP address. This is useful e.g. if sending multicast @@ -729,13 +1188,13 @@ and the host has multiple interfaces, where the user can choose which interface to send on by specifying the IP address of that interface. @item pkt_size=@var{size} -set the size in bytes of UDP packets +Set the size in bytes of UDP packets. @item reuse=@var{1|0} -explicitly allow or disallow reusing UDP sockets +Explicitly allow or disallow reusing UDP sockets. @item ttl=@var{ttl} -set the time to live value (for multicast only) +Set the time to live value (for multicast only). @item connect=@var{1|0} Initialize the UDP socket with @code{connect()}. In this case, the @@ -755,24 +1214,50 @@ specified sender IP addresses. @item block=@var{address}[,@var{address}] Ignore packets sent to the multicast group from the specified sender IP addresses. + +@item fifo_size=@var{units} +Set the UDP receiving circular buffer size, expressed as a number of +packets with size of 188 bytes. If not specified defaults to 7*4096. + +@item overrun_nonfatal=@var{1|0} +Survive in case of UDP receiving circular buffer overrun. Default +value is 0. + +@item timeout=@var{microseconds} +Set raise error timeout, expressed in microseconds. + +This option is only relevant in read mode: if no data arrived in more +than this time interval, raise error. + +@item broadcast=@var{1|0} +Explicitly allow or disallow UDP broadcasting. + +Note that broadcasting may not work properly on networks having +a broadcast storm protection. @end table -Some usage examples of the udp protocol with @command{avconv} follow. +@subsection Examples -To stream over UDP to a remote endpoint: +@itemize +@item +Use @command{ffmpeg} to stream over UDP to a remote endpoint: @example -avconv -i @var{input} -f @var{format} udp://@var{hostname}:@var{port} +ffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port} @end example -To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer: +@item +Use @command{ffmpeg} to stream in mpegts format over UDP using 188 +sized UDP packets, using a large input buffer: @example -avconv -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535 +ffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535 @end example -To receive over UDP from a remote endpoint: +@item +Use @command{ffmpeg} to receive over UDP from a remote endpoint: @example -avconv -i udp://[@var{multicast-address}]:@var{port} +ffmpeg -i udp://[@var{multicast-address}]:@var{port} ... @end example +@end itemize @section unix |