http


HTTP (Hyper Text Transfer Protocol).

This protocol accepts the following options:

'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.

'chunked_post'

If set to 1 use chunked Transfer-Encoding for posts, default is 1.

'content_type'

Set a specific content type for the POST messages or for listen mode.

'http_proxy'

set HTTP proxy to tunnel through e.g. http://example.com:1234

'headers'

Set custom HTTP headers, can override built in default headers. The value must be a string encoding the headers.

'multiple_requests'

Use persistent connections if set to 1, default is 0.

'post_data'

Set custom HTTP post data.

'referer'

Set the Referer header. Include 'Referer: URL' header in HTTP request.

'user_agent'

Override the User-Agent header. If not specified the protocol will use a string describing the libavformat build. ("Lavf/<version>")

'user-agent'

This is a deprecated option, you can use user_agent instead it.

'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.

'reconnect_at_eof'

If set then eof is treated like an error and causes reconnection, this is useful for live / endless streams.

'reconnect_streamed'

If set then even streamed/non seekable streams will be reconnected on errors.

'reconnect_delay_max'

Sets the maximum delay in seconds after which to give up reconnecting

'mime_type'

Export the MIME type.

'http_version'

Exports the HTTP response version number. Usually "1.0" or "1.1".

'icy'

If set to 1 request ICY (SHOUTcast) metadata from the server. If the server supports this, the metadata has to be retrieved by the application by reading the 'icy_metadata_headers' and 'icy_metadata_packet' options. The default is 1.

'icy_metadata_headers'

If the server supports ICY metadata, this contains the ICY-specific HTTP reply headers, separated by newline characters.

'icy_metadata_packet'

If the server supports ICY metadata, and 'icy' was set to 1, this 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.

'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.

'offset'

Set initial byte offset.

'end_offset'

Try to limit the request to bytes preceding this offset.

'method'

When used as a client option it sets the HTTP method for the request.

When used as a server option it sets the HTTP method that is going to be expected from the client(s). If the expected and the received HTTP method do not match the client will be given a Bad Request response. When unset the HTTP method is not checked for now. This will be replaced by autodetection in the future.

'listen'

If set to 1 enables experimental HTTP server. This can be used to send data when used as an output option, or read data from a client with HTTP POST when used as an input option. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented in ffmpeg.c and thus must not be used as a command line option.

# Server side (sending):
ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://server:port
# Client side (receiving):
ffmpeg -i http://server:port -c copy somefile.ogg
# Client can also be done with wget:
wget http://server:port -O somefile.ogg
# Server side (receiving):
ffmpeg -listen 1 -i http://server:port -c copy somefile.ogg
# Client side (sending):
ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://server:port
# Client can also be done with wget:
wget --post-file=somefile.ogg http://server:port
'send_expect_100'

Send an Expect: 100-continue header for POST. If set to 1 it will send, if set to 0 it won't, if set to -1 it will try to send if it is applicable. Default value is -1.

Some HTTP requests will be denied unless cookie values are passed in with the request. The '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:

ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8