# man > ffmpeg-protocols(1)

---
type: CommandReference
command: ffmpeg-protocols
mode: man
section: 1
source: man-pages
---

## Quick Reference
- `ffmpeg -i file:input.mpeg output.mpeg` — read local file (file protocol implicit)
- `ffplay http://server/stream.m3u8` — stream HLS over HTTP
- `cat test.wav | ffmpeg -i pipe:0` — read from stdin via pipe protocol
- `ffmpeg -re -i input -f mpegts udp://host:port?pkt_size=188` — stream MPEG-TS over UDP
- `ffmpeg -re -i input -f flv rtmp://server/live/stream` — stream to RTMP server
- `ffmpeg -i input -f format tcp://host:port?listen` — act as TCP server
- `ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg` — concatenate multiple files on the fly
- `ffmpeg -re -i input -f mpegts srt://host:port?mode=listener&latency=200000` — low-latency reliable streaming with SRT

## Name
ffmpeg-protocols — FFmpeg input and output protocols

## Synopsis
Protocols are specified in URLs, e.g. `protocol://resource?options`. Generic options can be set with `-option value` on the command line. The syntax for most protocols is:
ffmpeg -i protocol://[user[:password]@]host[:port]/path
## Options
### Generic protocol options
- `protocol_whitelist list` (input) — comma-separated list of allowed protocols. `"ALL"` for all; prefix with `-` to disable. Default: all allowed (nested protocols restricted to a subset).
- `rw_timeout` — maximum time in microseconds to wait for read/write operations.

### Specific protocols

#### file — local file access
Syntax: `file:filename` (default protocol if no prefix). Options:
- `truncate` — 0 (default 1) prevents file truncation on write.
- `blocksize` — max I/O block size in bytes (default INT_MAX).
- `follow` — if 1, retry reading at EOF for growing files.
- `seekable` — 0=non-seekable, -1=auto (default).

#### pipe — UNIX pipes
Syntax: `pipe:[fd]` (0=stdin, 1=stdout, 2=stderr; default stdin for read, stdout for write). Options: `blocksize` (see file).

#### concat — physical concatenation
Syntax: `concat:URL1|URL2|...|URLN`. Joins multiple resources sequentially. Escape `|` in shell.

#### cache — caching wrapper for input
Syntax: `cache:URL`. Enables seeking on live streams. Options:
- `read_ahead_limit` — bytes to read ahead when seeking unsupported (default 65536, -1=unlimited).

#### async — asynchronous data filler (input)
Syntax: `async:URL`. Fills data in background thread, e.g. `async:http://…` or `async:cache:http://…`.

#### http — Hyper Text Transfer Protocol
Syntax: `http://host[:port]/resource`. Options:
- `seekable` — 0/1/-1 (auto). Default -1.
- `chunked_post` — use chunked transfer encoding for POST (default 1).
- `content_type` — set Content-Type header.
- `http_proxy` — proxy URL, e.g. `http://proxy:1234`.
- `headers` — custom HTTP headers (multi-line string).
- `multiple_requests` — persistent connections (0/1, default 0).
- `post_data` — custom POST data.
- `referer` — set Referer header.
- `user_agent` — override User-Agent (default `Lavf/<version>`). Deprecated: `user-agent`.
- `reconnect_at_eof` — reconnect on EOF (useful for live streams).
- `reconnect_streamed` — reconnect streamed/non-seekable streams on error.
- `reconnect_on_network_error` — reconnect on TCP/TLS connect errors.
- `reconnect_on_http_error` — comma-separated list of HTTP status codes (e.g. `503,4xx`) to trigger reconnect.
- `reconnect_delay_max` — maximum delay in seconds before giving up reconnection.
- `mime_type` — export MIME type.
- `http_version` — exports HTTP response version (e.g. `1.0`, `1.1`).
- `icy` — request ICY metadata (SHOUTcast), default 1.
- `icy_metadata_headers` — ICY-specific headers (if available).
- `icy_metadata_packet` — the last non‑empty metadata packet from server.
- `cookies` — cookies to send; format: `name=value; path=...; domain=...;`. Delimit multiple with newline.
- `offset` — initial byte offset for request.
- `end_offset` — limit request to bytes before this offset.
- `method` — HTTP method (GET, POST, etc.). For servers, expected method.
- `listen` — 1: single‑client HTTP server; 2: experimental multi‑client (not for CLI). See examples.
- `send_expect_100` — send `Expect: 100-continue`. -1 auto, 0/1 override.
- `auth_type` — `none` (auto), `basic`.

#### hls — Apple HTTP Live Streaming
Syntax: `hls+http://…` or `hls+file://…`. Discouraged; use the HLS demuxer directly with M3U8 URLs.

#### ftp — File Transfer Protocol
Syntax: `ftp://[user:password@]server[:port]/path`. Options:
- `timeout` — socket I/O timeout in µs (default -1).
- `ftp-user`, `ftp-password` — override URL credentials.
- `ftp-anonymous-password` — anonymous login password (defaults to e‑mail).
- `ftp-write-seekable` — seekability flag for output (0/1, default 0).

#### gopher / gophers
Gopher protocol (`gopher://…`) and Gopher with TLS (`gophers://…`).

#### icecast — streaming to Icecast servers
Syntax: `icecast://[user[:password]@]server:port/mountpoint`. Options: `ice_genre`, `ice_name`, `ice_description`, `ice_url`, `ice_public` (0/1), `user_agent`, `password`, `content_type`, `legacy_icecast` (for versions <2.4.0), `tls` (HTTPS).

#### rtmp — Real‑Time Messaging Protocol
Syntax: `rtmp://[user:password@]server[:port]/[app]/[playpath]`. Options (set via `‑RTMP_*` or as URI query):
- `rtmp_app` — application name.
- `rtmp_playpath` — stream identifier.
- `rtmp_live` — `any`, `live`, `recorded`.
- `rtmp_swfurl`, `rtmp_swfverify`, `rtmp_swfhash`, `rtmp_swfsize` — SWF verification.
- `rtmp_tcurl` — target stream URL.
- `rtmp_flashver` — Flash plugin version.
- `rtmp_conn` — extra AMF connection parameters.
- `rtmp_flush_interval` — packet flush count (RTMPT only).
- `rtmp_buffer` — client buffer time (ms, default 3000).
- `timeout` — incoming connection wait.
- `listen` — act as server.

Encrypted variants: **rtmpe**, **rtmps** (SSL). Tunneled variants: **rtmpt**, **rtmpte**, **rtmpts**. All share RTMP options.

#### rtp — Real‑time Transport Protocol
Syntax: `rtp://hostname[:port][?option=val...]`. URL options:
- `ttl`, `rtcpport`, `localrtpport`, `localrtcpport`, `pkt_size`, `buffer_size`.
- `connect` — 0/1.
- `sources`, `block` — IP lists.
- `write_to_source` — 0/1.
- `localport` — deprecated; use `localrtpport`.

#### rtsp — Real‑Time Streaming Protocol
Syntax: `rtsp://hostname[:port]/path`. Options:
- `rtsp_transport` — `udp`, `tcp`, `udp_multicast`, `http`.
- `rtsp_flags` — `filter_src`, `listen`, `prefer_tcp`.
- `allowed_media_types` — `video`, `audio`, `data`.
- `min_port`, `max_port` — UDP port range (default 5000‑65000).
- `timeout` — infinite if -1; implies `listen`.
- `reorder_queue_size` — packet reordering buffer size.
- `stimeout` — socket TCP I/O timeout in µs.
- `user-agent` — override User-Agent.

#### sap — Session Announcement Protocol
Muxer syntax: `sap://destination[:port][?options]`. Options: `announce_addr`, `announce_port`, `ttl`, `same_port`. Demuxer syntax: `sap://[address][:port]`. Listens for SAP announcements and auto‑starts reception.

#### srt — Secure Reliable Transport (Haivision)
Syntax: `srt://hostname:port[?options]` or `-option val srt://...`. Key options:
- `mode` — `caller`, `listener`, `rendezvous`.
- `latency` — delivery delay in µs (sets `rcvlatency` and `peerlatency`).
- `rcvlatency`, `peerlatency` — separate latency values.
- `connect_timeout`, `listen_timeout`, `timeout` — in µs.
- `maxbw`, `inputbw`, `oheadbw` — bandwidth control.
- `mss` — max segment size (default 1500).
- `payload_size` / `pkt_size` — max packet size (default 1316 for live).
- `ffs` — flight flag size.
- `recv_buffer_size`, `send_buffer_size`.
- `passphrase`, `pbkeylen`, `enforced_encryption` — encryption.
- `transtype` — `live` or `file`.
- `messageapi` — 0 (stream) or 1 (message).
- `tlpktdrop` — too‑late packet drop.
- `streamid` — optional stream identifier.
- `minversion` — hex version (e.g. `0x010300`).
- See [Haivision/srt](https://github.com/Haivision/srt) for more.

#### srtp — Secure RTP
Syntax: `srtp://host…`. Options: `srtp_in_suite`, `srtp_out_suite` (AES_CM_128_HMAC_SHA1_80 etc.), `srtp_in_params`, `srtp_out_params` (base64 master key + salt).

#### rist — Reliable Internet Streaming Transport
Options: `rist_profile` (simple, main, advanced), `buffer_size`, `pkt_size`, `log_level`, `secret`, `encryption` (128, 256).

#### udp — User Datagram Protocol
Syntax: `udp://hostname:port[?options]`. Options:
- `buffer_size` — socket buffer size in bytes.
- `bitrate` — constant output bitrate if nonzero.
- `burst_bits` — max bits in bursts for `bitrate`.
- `localport`, `localaddr`.
- `pkt_size` — packet size.
- `reuse` — 0/1.
- `ttl` — multicast TTL.
- `connect` — 0/1.
- `sources`, `block` — address lists.
- `fifo_size` — circular buffer size in 188‑byte units (default 7*4096).
- `overrun_nonfatal` — survive buffer overruns.
- `timeout` — raise error if no data within µs.
- `broadcast` — 0/1.

#### tcp — Transmission Control Protocol
Syntax: `tcp://hostname:port[?options]`. Options:
- `listen` — 0 (off), 1 (single client), 2 (multi‑client).
- `timeout` — read timeout in µs.
- `listen_timeout` — ms.
- `recv_buffer_size`, `send_buffer_size` — bytes.
- `tcp_nodelay` — disable Nagle (0/1).
- `tcp_mss` — max segment size.

#### tls / ssl — Transport Layer Security
Syntax: `tls://hostname:port[?options]`. Options:
- `ca_file` / `cafile` — trusted root CA file (PEM).
- `tls_verify` — 0/1 (default 0).
- `cert_file` / `cert` — certificate file.
- `key_file` / `key` — private key file.
- `listen` — 0/1 (server mode).
- `http_proxy` — use HTTP CONNECT proxy.

#### sctp — Stream Control Transmission Protocol
Syntax: `sctp://host:port[?options]`. Options: `listen`, `max_streams`.

#### zmq — ZeroMQ messaging (via libzmq)
Syntax: `zmq:tcp://ip:port`. Publish‑subscribe pattern. Options: `pkt_size` (default 131072). Requires `--enable-libzmq`.

#### amqp — Advanced Message Queueing Protocol (0-9-1)
Requires `--enable-librabbitmq`. Syntax: `amqp://[[user]:[password]@]hostname[:port][/vhost]`. Options: `exchange` (default `amq.direct`), `routing_key`, `pkt_size`, `connection_timeout`, `delivery_mode` (`persistent` or `non-persistent`).

#### libsmbclient — CIFS/SMB
Syntax: `smb://[[domain:]user[:password@]]server[/share[/path[/file]]]`. Options: `timeout`, `truncate`, `workgroup`.

#### libssh — SFTP via libssh
Syntax: `sftp://[user[:password]@]server[:port]/path`. Options: `timeout`, `truncate`, `private_key` (default `~/.ssh/`).

#### bluray — read Blu‑ray playlists
Syntax: `bluray:/mnt/bluray`. Options: `angle`, `chapter`, `playlist` (e.g., `BDMV/PLAYLIST/00000.mpls`).

#### crypto — AES‑encrypted stream
Syntax: `crypto:URL` or `crypto+URL`. Options: `key` (hex key), `iv` (hex initialization vector).

#### data — inline data URI
Syntax: `data:image/gif;base64,...`. Converts inline data.

#### md5 — MD5 hash output
Syntax: `md5:filename` or `md5:`. Writes MD5 hash instead of actual file data. Not seekable.

#### prompeg — Pro‑MPEG CoP #3 FEC
Used with `-f rtp_mpegts` muxer and RTP. Syntax: `-fec prompeg=l=<cols>:d=<rows>`. Col/row range 4‑20, L×D ≤ 100. Example: `-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://host:port`.

#### subfile — extract a segment
Syntax: `subfile,,start,SIZE,end,SIZE,,:URL`. Unit: bytes. Underlying stream must be seekable.

#### tee — replicate output to multiple protocols
Syntax: `tee:protocol1|protocol2|...`

#### mmst, mmsh — Microsoft Media Server
`mmst://...` (TCP), `mmsh://server[:port][/app][/playpath]` (HTTP).

#### unix — local Unix sockets
Syntax: `unix://filepath`. Options: `timeout`, `listen`.

## Examples
shell
# Read angle 2 of playlist 4, start from chapter 2 on Blu‑ray
ffplay -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray

# Decrypt an AES‑encrypted stream
ffplay crypto+http://example.com/encrypted.ts?key=1a2b3c4d...&iv=...

# Compute MD5 of encoded output (without writing media to disk)
ffmpeg -i input.flv -f avi md5:output.avi.md5

# Concatenate two remote resources
ffplay concat:http://example.com/part1.mpg|http://example.com/part2.mpg

# Extract a DVD chapter (sector offsets multiplied by 2048)
ffplay subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB

# Stream via RTSP to a server for others to watch
ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp

# Act as RTSP server and receive stream
ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp output.ts
## See Also
- [ffmpeg(1)](http://localhost/phpMan.php/man/ffmpeg/1/markdown)
- [ffplay(1)](http://localhost/phpMan.php/man/ffplay/1/markdown)
- [ffprobe(1)](http://localhost/phpMan.php/man/ffprobe/1/markdown)
- [libavformat(3)](http://localhost/phpMan.php/man/libavformat/3/markdown)