2208 lines · 66.7 KB · Text
RawDownload
@chapter Protocol Options@c man begin PROTOCOL OPTIONS The libavformat library provides some generic global options, whichcan be set on all the protocols. In addition each protocol may supportso-called private options, which are specific for that component. Options may be set by specifying -@var{option} @var{value} in theFFmpeg tools, or by setting the value explicitly in the@code{AVFormatContext} options or using the @file{libavutil/opt.h} APIfor programmatic use. The list of supported options follows: @table @option@item protocol_whitelist @var{list} (@emph{input})Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocolsprefixed by "-" are disabled.All protocols are allowed by default but protocols used by an anotherprotocol (nested protocols) are restricted to a per protocol subset.@end table @c man end PROTOCOL OPTIONS @chapter Protocols@c man begin PROTOCOLS Protocols are configured elements in FFmpeg that enable access toresources that require specific protocols. When you configure your FFmpeg build, all the supported protocols areenabled by default. You can list all available ones using theconfigure option "--list-protocols". You can disable all the protocols using the configure option"--disable-protocols", and selectively enable a protocol using theoption "--enable-protocol=@var{PROTOCOL}", or you can disable aparticular protocol using the option"--disable-protocol=@var{PROTOCOL}". The option "-protocols" of the ff* tools will display the list ofsupported protocols. All protocols accept the following options: @table @option@item rw_timeoutMaximum time to wait for (network) read/write operations to complete,in microseconds.@end table A description of the currently available protocols follows. @section amqp Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker basedpublish-subscribe communication protocol. FFmpeg must be compiled with --enable-librabbitmq to support AMQP. A separateAMQP broker must also be run. An example open-source AMQP broker is RabbitMQ. After starting the broker, an FFmpeg client may stream data to the broker usingthe command: @exampleffmpeg -re -i input -f mpegts amqp://[[user]:[password]@@]hostname[:port][/vhost]@end example Where hostname and port (default is 5672) is the address of the broker. Theclient may also set a user/password for authentication. The default for bothfields is "guest". Name of virtual host on broker can be set with vhost. Thedefault value is "/". Muliple subscribers may stream from the broker using the command:@exampleffplay amqp://[[user]:[password]@@]hostname[:port][/vhost]@end example In RabbitMQ all data published to the broker flows through a specific exchange,and each subscribing client has an assigned queue/buffer. When a packet arrivesat an exchange, it may be copied to a client's queue depending on the exchangeand routing_key fields. The following options are supported: @table @option @item exchangeSets the exchange to use on the broker. RabbitMQ has several predefinedexchanges: "amq.direct" is the default exchange, where the publisher andsubscriber must have a matching routing_key; "amq.fanout" is the same as abroadcast operation (i.e. the data is forwarded to all queues on the fanoutexchange independent of the routing_key); and "amq.topic" is similar to"amq.direct", but allows for more complex pattern matching (refer to the RabbitMQdocumentation). @item routing_keySets the routing key. The default value is "amqp". The routing key is used onthe "amq.direct" and "amq.topic" exchanges to decide whether packets are writtento the queue of a subscriber. @item pkt_sizeMaximum size of each packet sent/received to the broker. Default is 131072.Minimum is 4096 and max is any large value (representable by an int). Whenreceiving packets, this sets an internal buffer size in FFmpeg. It should beequal to or greater than the size of the published packets to the broker. Otherwisethe received message may be truncated causing decoding errors. @item connection_timeoutThe timeout in seconds during the initial connection to the broker. Thedefault value is rw_timeout, or 5 seconds if rw_timeout is not set. @item delivery_mode @var{mode}Sets the delivery mode of each message sent to broker.The following values are accepted:@table @samp@item persistentDelivery mode set to "persistent" (2). This is the default value.Messages may be written to the broker's disk depending on its setup. @item non-persistentDelivery mode set to "non-persistent" (1).Messages will stay in broker's memory unless the broker is under memorypressure. @end table @end table @section async Asynchronous data filling wrapper for input stream. Fill data in a background thread, to decouple I/O operation from demux thread. @exampleasync:@var{URL}async:http://host/resourceasync:cache:http://host/resource@end example @section bluray Read BluRay playlist. The accepted options are:@table @option @item angleBluRay angle @item chapterStart chapter (1...N) @item playlistPlaylist to read (BDMV/PLAYLIST/?????.mpls) @end table Examples: Read longest playlist from BluRay mounted to /mnt/bluray:@examplebluray:/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. The accepted options are:@table @option @item read_ahead_limitAmount in bytes that may be read ahead when seeking isn't supported. Range is -1 to INT_MAX.-1 for unlimited. Default is 65536. @end table URL Syntax is@examplecache:@var{URL}@end example @section concat Physical concatenation protocol. Read and seek from many resources in sequence as if they werea unique resource. A URL accepted by this protocol has the syntax:@exampleconcat:@var{URL1}|@var{URL2}|...|@var{URLN}@end example where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of theresource to be concatenated, each one possibly specifying a distinctprotocol. For example to read a sequence of files @file{split1.mpeg},@file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use thecommand:@exampleffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg@end example Note that you may need to escape the character "|" which is special formany shells. @section concatf Physical concatenation protocol using a line break delimited list ofresources. Read and seek from many resources in sequence as if they werea unique resource. A URL accepted by this protocol has the syntax:@exampleconcatf:@var{URL}@end example where @var{URL} is the url containing a line break delimited list ofresources to be concatenated, each one possibly specifying a distinctprotocol. Special characters must be escaped with backslash or singlequotes. See @ref{quoting_and_escaping,,the "Quoting and escaping"section in the ffmpeg-utils(1) manual,ffmpeg-utils}. For example to read a sequence of files @file{split1.mpeg},@file{split2.mpeg}, @file{split3.mpeg} listed in separate lines withina file @file{split.txt} with @command{ffplay} use the command:@exampleffplay concatf:split.txt@end exampleWhere @file{split.txt} contains the lines:@examplesplit1.mpegsplit2.mpegsplit3.mpeg@end example @section crypto AES-encrypted stream reading protocol. The accepted options are:@table @option@item keySet the AES decryption key binary block from given hexadecimal representation. @item ivSet the AES decryption initialization vector binary block from given hexadecimal representation.@end table Accepted URL formats:@examplecrypto:@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}:@exampleffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png@end example @section fd File descriptor access protocol. The accepted syntax is:@examplefd: -fd @var{file_descriptor}@end example If @option{fd} is not specified, by default the stdout file descriptor will beused for writing, stdin for reading. Unlike the pipe protocol, fd protocol hasseek support if it corresponding to a regular file. fd protocol doesn't supportpass file descriptor via URL for security. This protocol accepts the following options: @table @option@item blocksizeSet 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 reactiontime, which is valuable if data transmission is slow. @item fdSet file descriptor.@end table @section file File access protocol. Read from or write to a file. A file URL can have the form:@examplefile:@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 afile URL. Depending on the build, an URL that looks like a Windowspath with the drive letter at the beginning will also be assumed to bea file URL (usually not the case in builds for unix-like systems). For example to read from a file @file{input.mpeg} with @command{ffmpeg}use the command:@exampleffmpeg -i file:input.mpeg output.mpeg@end example This protocol accepts the following options: @table @option@item truncateTruncate existing files on write, if set to 1. A value of 0 preventstruncating. Default value is 1. @item blocksizeSet 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 reactiontime, which is valuable for files on slow medium. @item followIf set to 1, the protocol will retry reading at the end of the file, allowingreading files that still are being written. In order for this to terminate,you either need to use the rw_timeout option, or use the interrupt callback(for API users). @item seekableControls if seekability is advertised on the file. 0 means non-seekable, -1means auto (seekable for normal files, non-seekable for named pipes). Many demuxers handle seekable and non-seekable resources differently,overriding this might speed up opening certain files at the cost of losing somefeatures (e.g. accurate seeking).@end table @section ftp FTP (File Transfer Protocol). Read from or write to remote resources using FTP protocol. Following syntax is required.@exampleftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg@end example This protocol accepts the following options. @table @option@item timeoutSet timeout in microseconds of socket I/O operations used by the underlying low leveloperation. By default it is set to -1, which means that the timeout isnot specified. @item ftp-userSet a user to be used for authenticating to the FTP server. This is overridden by theuser in the FTP URL. @item ftp-passwordSet a password to be used for authenticating to the FTP server. This is overridden bythe password in the FTP URL, or by @option{ftp-anonymous-password} if no user is set. @item ftp-anonymous-passwordPassword used when login as anonymous user. Typically an e-mail addressshould be used. @item ftp-write-seekableControl seekability of connection during encoding. If set to 1 theresource is supposed to be seekable, if set to 0 it is assumed notto be seekable. Default value is 0.@end table NOTE: Protocol can be used as output, but it is recommended to not doit, unless special care is taken (tests, customized server configurationetc.). Different FTP servers behave in different way during seekoperation. ff* tools may produce incomplete content due to server limitations. @section gopher Gopher protocol. @section gophers Gophers protocol. The Gopher protocol with TLS encapsulation. @section hls Read Apple HTTP Live Streaming compliant segmented stream asa uniform one. The M3U8 playlists describing the segments can beremote HTTP resources or local files, accessed using the standardfile protocol.The nested protocol is declared by specifying"+@var{proto}" after the hls URI scheme name, where @var{proto}is either "file" or "http". @examplehls+http://host/path/to/remote/resource.m3u8hls+file://path/to/local/resource.m3u8@end example Using this protocol is discouraged - the hls demuxer should workjust as well (if not, please report the issues) and is more complete.To use the hls demuxer instead, simply use the direct URLs to them3u8 files. @section http HTTP (Hyper Text Transfer Protocol). This protocol accepts the following options: @table @option@item seekableControl seekability of connection. If set to 1 the resource issupposed 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. Defaultvalue is -1. @item chunked_postIf set to 1 use chunked Transfer-Encoding for posts, default is 1. @item http_proxyset HTTP proxy to tunnel through e.g. http://example.com:1234 @item headersSet custom HTTP headers, can override built in default headers. Thevalue must be a string encoding the headers. @item content_typeSet a specific content type for the POST messages or for listen mode. @item user_agentOverride the User-Agent header. If not specified the protocol will use astring describing the libavformat build. ("Lavf/<version>") @item refererSet the Referer header. Include 'Referer: URL' header in HTTP request. @item multiple_requestsUse persistent connections if set to 1, default is 0. @item post_dataSet custom HTTP post data. @item mime_typeExport the MIME type. @item http_versionExports the HTTP response version number. Usually "1.0" or "1.1". @item cookiesSet the cookies to be sent in future requests. The format of each cookie is thesame as the value of a Set-Cookie HTTP response field. Multiple cookies can bedelimited by a newline character. @item icyIf set to 1 request ICY (SHOUTcast) metadata from the server. If the serversupports this, the metadata has to be retrieved by the application by readingthe @option{icy_metadata_headers} and @option{icy_metadata_packet} options.The default is 1. @item icy_metadata_headersIf the server supports ICY metadata, this contains the ICY-specific HTTP replyheaders, separated by newline characters. @item icy_metadata_packetIf the server supports ICY metadata, and @option{icy} was set to 1, thiscontains the last non-empty metadata packet sent by the server. It should bepolled in regular intervals by applications interested in mid-stream metadataupdates. @item metadataSet an exported dictionary containing Icecast metadata from the bitstream, if present.Only useful with the C API. @item auth_type 

Lines 1–500 of 2208.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t