4 Protocols are configured elements in FFmpeg that enable access to
5 resources that require specific protocols.
7 When you configure your FFmpeg build, all the supported protocols are
8 enabled by default. You can list all available ones using the
9 configure option "--list-protocols".
11 You can disable all the protocols using the configure option
12 "--disable-protocols", and selectively enable a protocol using the
13 option "--enable-protocol=@var{PROTOCOL}", or you can disable a
14 particular protocol using the option
15 "--disable-protocol=@var{PROTOCOL}".
17 The option "-protocols" of the ff* tools will display the list of
20 A description of the currently available protocols follows.
24 Asynchronous data filling wrapper for input stream.
26 Fill data in a background thread, to decouple I/O operation from demux thread.
30 async:http://host/resource
31 async:cache:http://host/resource
38 The accepted options are:
48 Playlist to read (BDMV/PLAYLIST/?????.mpls)
54 Read longest playlist from BluRay mounted to /mnt/bluray:
59 Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
61 -playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
66 Caching wrapper for input stream.
68 Cache the input stream to temporary file. It brings seeking capability to live streams.
76 Physical concatenation protocol.
78 Read and seek from many resources in sequence as if they were
81 A URL accepted by this protocol has the syntax:
83 concat:@var{URL1}|@var{URL2}|...|@var{URLN}
86 where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the
87 resource to be concatenated, each one possibly specifying a distinct
90 For example to read a sequence of files @file{split1.mpeg},
91 @file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use the
94 ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
97 Note that you may need to escape the character "|" which is special for
102 AES-encrypted stream reading protocol.
104 The accepted options are:
107 Set the AES decryption key binary block from given hexadecimal representation.
110 Set the AES decryption initialization vector binary block from given hexadecimal representation.
113 Accepted URL formats:
121 Data in-line in the URI. See @url{http://en.wikipedia.org/wiki/Data_URI_scheme}.
123 For example, to convert a GIF file given inline with @command{ffmpeg}:
125 ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
130 File access protocol.
132 Read from or write to a file.
134 A file URL can have the form:
139 where @var{filename} is the path of the file to read.
141 An URL that does not have a protocol prefix will be assumed to be a
142 file URL. Depending on the build, an URL that looks like a Windows
143 path with the drive letter at the beginning will also be assumed to be
144 a file URL (usually not the case in builds for unix-like systems).
146 For example to read from a file @file{input.mpeg} with @command{ffmpeg}
149 ffmpeg -i file:input.mpeg output.mpeg
152 This protocol accepts the following options:
156 Truncate existing files on write, if set to 1. A value of 0 prevents
157 truncating. Default value is 1.
160 Set I/O operation maximum block size, in bytes. Default value is
161 @code{INT_MAX}, which results in not limiting the requested block size.
162 Setting this value reasonably low improves user termination request reaction
163 time, which is valuable for files on slow medium.
168 FTP (File Transfer Protocol).
170 Read from or write to remote resources using FTP protocol.
172 Following syntax is required.
174 ftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg
177 This protocol accepts the following options.
181 Set timeout in microseconds of socket I/O operations used by the underlying low level
182 operation. By default it is set to -1, which means that the timeout is
185 @item ftp-anonymous-password
186 Password used when login as anonymous user. Typically an e-mail address
189 @item ftp-write-seekable
190 Control seekability of connection during encoding. If set to 1 the
191 resource is supposed to be seekable, if set to 0 it is assumed not
192 to be seekable. Default value is 0.
195 NOTE: Protocol can be used as output, but it is recommended to not do
196 it, unless special care is taken (tests, customized server configuration
197 etc.). Different FTP servers behave in different way during seek
198 operation. ff* tools may produce incomplete content due to server limitations.
206 Read Apple HTTP Live Streaming compliant segmented stream as
207 a uniform one. The M3U8 playlists describing the segments can be
208 remote HTTP resources or local files, accessed using the standard
210 The nested protocol is declared by specifying
211 "+@var{proto}" after the hls URI scheme name, where @var{proto}
212 is either "file" or "http".
215 hls+http://host/path/to/remote/resource.m3u8
216 hls+file://path/to/local/resource.m3u8
219 Using this protocol is discouraged - the hls demuxer should work
220 just as well (if not, please report the issues) and is more complete.
221 To use the hls demuxer instead, simply use the direct URLs to the
226 HTTP (Hyper Text Transfer Protocol).
228 This protocol accepts the following options:
232 Control seekability of connection. If set to 1 the resource is
233 supposed to be seekable, if set to 0 it is assumed not to be seekable,
234 if set to -1 it will try to autodetect if it is seekable. Default
238 If set to 1 use chunked Transfer-Encoding for posts, default is 1.
241 Set a specific content type for the POST messages.
244 Set custom HTTP headers, can override built in default headers. The
245 value must be a string encoding the headers.
247 @item multiple_requests
248 Use persistent connections if set to 1, default is 0.
251 Set custom HTTP post data.
255 Override the User-Agent header. If not specified the protocol will use a
256 string describing the libavformat build. ("Lavf/<version>")
259 Set timeout in microseconds of socket I/O operations used by the underlying low level
260 operation. By default it is set to -1, which means that the timeout is
264 Export the MIME type.
267 If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
268 supports this, the metadata has to be retrieved by the application by reading
269 the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
272 @item icy_metadata_headers
273 If the server supports ICY metadata, this contains the ICY-specific HTTP reply
274 headers, separated by newline characters.
276 @item icy_metadata_packet
277 If the server supports ICY metadata, and @option{icy} was set to 1, this
278 contains the last non-empty metadata packet sent by the server. It should be
279 polled in regular intervals by applications interested in mid-stream metadata
283 Set the cookies to be sent in future requests. The format of each cookie is the
284 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
285 delimited by a newline character.
288 Set initial byte offset.
291 Try to limit the request to bytes preceding this offset.
294 When used as a client option it sets the HTTP method for the request.
296 When used as a server option it sets the HTTP method that is going to be
297 expected from the client(s).
298 If the expected and the received HTTP method do not match the client will
299 be given a Bad Request response.
300 When unset the HTTP method is not checked for now. This will be replaced by
301 autodetection in the future.
304 If set to 1 enables experimental HTTP server. This can be used to send data when
305 used as an output option, or read data from a client with HTTP POST when used as
308 # Server side (sending):
309 ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://@var{server}:@var{port}
311 # Client side (receiving):
312 ffmpeg -i http://@var{server}:@var{port} -c copy somefile.ogg
314 # Client can also be done with wget:
315 wget http://@var{server}:@var{port} -O somefile.ogg
317 # Server side (receiving):
318 ffmpeg -listen 1 -i http://@var{server}:@var{port} -c copy somefile.ogg
320 # Client side (sending):
321 ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{port}
323 # Client can also be done with wget:
324 wget --post-file=somefile.ogg http://@var{server}:@var{port}
329 @subsection HTTP Cookies
331 Some HTTP requests will be denied unless cookie values are passed in with the
332 request. The @option{cookies} option allows these cookies to be specified. At
333 the very least, each cookie must specify a value along with a path and domain.
334 HTTP requests that match both the domain and path will automatically include the
335 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
338 The required syntax to play a stream specifying a cookie is:
340 ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
345 Icecast protocol (stream to Icecast servers)
347 This protocol accepts the following options:
351 Set the stream genre.
356 @item ice_description
357 Set the stream description.
360 Set the stream website URL.
363 Set if the stream should be public.
364 The default is 0 (not public).
367 Override the User-Agent header. If not specified a string of the form
368 "Lavf/<version>" will be used.
371 Set the Icecast mountpoint password.
374 Set the stream content type. This must be set if it is different from
378 This enables support for Icecast versions < 2.4.0, that do not support the
379 HTTP PUT method but the SOURCE method.
384 icecast://[@var{username}[:@var{password}]@@]@var{server}:@var{port}/@var{mountpoint}
389 MMS (Microsoft Media Server) protocol over TCP.
393 MMS (Microsoft Media Server) protocol over HTTP.
395 The required syntax is:
397 mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
404 Computes the MD5 hash of the data to be written, and on close writes
405 this to the designated output or stdout if none is specified. It can
406 be used to test muxers without writing an actual file.
408 Some examples follow.
410 # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
411 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
413 # Write the MD5 hash of the encoded AVI file to stdout.
414 ffmpeg -i input.flv -f avi -y md5:
417 Note that some formats (typically MOV) require the output protocol to
418 be seekable, so they will fail with the MD5 output protocol.
422 UNIX pipe access protocol.
424 Read and write from UNIX pipes.
426 The accepted syntax is:
431 @var{number} is the number corresponding to the file descriptor of the
432 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{number}
433 is not specified, by default the stdout file descriptor will be used
434 for writing, stdin for reading.
436 For example to read from stdin with @command{ffmpeg}:
438 cat test.wav | ffmpeg -i pipe:0
439 # ...this is the same as...
440 cat test.wav | ffmpeg -i pipe:
443 For writing to stdout with @command{ffmpeg}:
445 ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
446 # ...this is the same as...
447 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
450 This protocol accepts the following options:
454 Set I/O operation maximum block size, in bytes. Default value is
455 @code{INT_MAX}, which results in not limiting the requested block size.
456 Setting this value reasonably low improves user termination request reaction
457 time, which is valuable if data transmission is slow.
460 Note that some formats (typically MOV), require the output protocol to
461 be seekable, so they will fail with the pipe output protocol.
465 Real-Time Messaging Protocol.
467 The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
468 content across a TCP/IP network.
470 The required syntax is:
472 rtmp://[@var{username}:@var{password}@@]@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
475 The accepted parameters are:
479 An optional username (mostly for publishing).
482 An optional password (mostly for publishing).
485 The address of the RTMP server.
488 The number of the TCP port to use (by default is 1935).
491 It is the name of the application to access. It usually corresponds to
492 the path where the application is installed on the RTMP server
493 (e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). You can override
494 the value parsed from the URI through the @code{rtmp_app} option, too.
497 It is the path or name of the resource to play with reference to the
498 application specified in @var{app}, may be prefixed by "mp4:". You
499 can override the value parsed from the URI through the @code{rtmp_playpath}
503 Act as a server, listening for an incoming connection.
506 Maximum time to wait for the incoming connection. Implies listen.
509 Additionally, the following parameters can be set via command line options
510 (or in code via @code{AVOption}s):
514 Name of application to connect on the RTMP server. This option
515 overrides the parameter specified in the URI.
518 Set the client buffer time in milliseconds. The default is 3000.
521 Extra arbitrary AMF connection parameters, parsed from a string,
522 e.g. like @code{B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0}.
523 Each value is prefixed by a single character denoting the type,
524 B for Boolean, N for number, S for string, O for object, or Z for null,
525 followed by a colon. For Booleans the data must be either 0 or 1 for
526 FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
527 1 to end or begin an object, respectively. Data items in subobjects may
528 be named, by prefixing the type with 'N' and specifying the name before
529 the value (i.e. @code{NB:myFlag:1}). This option may be used multiple
530 times to construct arbitrary AMF sequences.
533 Version of the Flash plugin used to run the SWF player. The default
534 is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
535 <libavformat version>).)
537 @item rtmp_flush_interval
538 Number of packets flushed in the same request (RTMPT only). The default
542 Specify that the media is a live stream. No resuming or seeking in
543 live streams is possible. The default value is @code{any}, which means the
544 subscriber first tries to play the live stream specified in the
545 playpath. If a live stream of that name is not found, it plays the
546 recorded stream. The other possible values are @code{live} and
550 URL of the web page in which the media was embedded. By default no
554 Stream identifier to play or to publish. This option overrides the
555 parameter specified in the URI.
558 Name of live stream to subscribe to. By default no value will be sent.
559 It is only sent if the option is specified or if rtmp_live
563 SHA256 hash of the decompressed SWF file (32 bytes).
566 Size of the decompressed SWF file, required for SWFVerification.
569 URL of the SWF player for the media. By default no value will be sent.
572 URL to player swf file, compute hash/size automatically.
575 URL of the target stream. Defaults to proto://host[:port]/app.
579 For example to read with @command{ffplay} a multimedia resource named
580 "sample" from the application "vod" from an RTMP server "myserver":
582 ffplay rtmp://myserver/vod/sample
585 To publish to a password protected server, passing the playpath and
586 app names separately:
588 ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@@myserver/
593 Encrypted Real-Time Messaging Protocol.
595 The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
596 streaming multimedia content within standard cryptographic primitives,
597 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
602 Real-Time Messaging Protocol over a secure SSL connection.
604 The Real-Time Messaging Protocol (RTMPS) is used for streaming
605 multimedia content across an encrypted connection.
609 Real-Time Messaging Protocol tunneled through HTTP.
611 The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
612 for streaming multimedia content within HTTP requests to traverse
617 Encrypted Real-Time Messaging Protocol tunneled through HTTP.
619 The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
620 is used for streaming multimedia content within HTTP requests to traverse
625 Real-Time Messaging Protocol tunneled through HTTPS.
627 The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
628 for streaming multimedia content within HTTPS requests to traverse
631 @section libsmbclient
633 libsmbclient permits one to manipulate CIFS/SMB network resources.
635 Following syntax is required.
638 smb://[[domain:]user[:password@@]]server[/share[/path[/file]]]
641 This protocol accepts the following options.
645 Set timeout in miliseconds of socket I/O operations used by the underlying
646 low level operation. By default it is set to -1, which means that the timeout
650 Truncate existing files on write, if set to 1. A value of 0 prevents
651 truncating. Default value is 1.
654 Set the workgroup used for making connections. By default workgroup is not specified.
658 For more information see: @url{http://www.samba.org/}.
662 Secure File Transfer Protocol via libssh
664 Read from or write to remote resources using SFTP protocol.
666 Following syntax is required.
669 sftp://[user[:password]@@]server[:port]/path/to/remote/resource.mpeg
672 This protocol accepts the following options.
676 Set timeout of socket I/O operations used by the underlying low level
677 operation. By default it is set to -1, which means that the timeout
681 Truncate existing files on write, if set to 1. A value of 0 prevents
682 truncating. Default value is 1.
685 Specify the path of the file containing private key to use during authorization.
686 By default libssh searches for keys in the @file{~/.ssh/} directory.
690 Example: Play a file stored on remote server.
693 ffplay sftp://user:password@@server_address:22/home/user/resource.mpeg
696 @section librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte
698 Real-Time Messaging Protocol and its variants supported through
701 Requires the presence of the librtmp headers and library during
702 configuration. You need to explicitly configure the build with
703 "--enable-librtmp". If enabled this will replace the native RTMP
706 This protocol provides most client functions and a few server
707 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
708 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
709 variants of these encrypted types (RTMPTE, RTMPTS).
711 The required syntax is:
713 @var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options}
716 where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe",
717 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
718 @var{server}, @var{port}, @var{app} and @var{playpath} have the same
719 meaning as specified for the RTMP native protocol.
720 @var{options} contains a list of space-separated options of the form
723 See the librtmp manual page (man 3 librtmp) for more information.
725 For example, to stream a file in real-time to an RTMP server using
728 ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
731 To play the same stream using @command{ffplay}:
733 ffplay "rtmp://myserver/live/mystream live=1"
738 Real-time Transport Protocol.
740 The required syntax for an RTP URL is:
741 rtp://@var{hostname}[:@var{port}][?@var{option}=@var{val}...]
743 @var{port} specifies the RTP port to use.
745 The following URL options are supported:
750 Set the TTL (Time-To-Live) value (for multicast only).
752 @item rtcpport=@var{n}
753 Set the remote RTCP port to @var{n}.
755 @item localrtpport=@var{n}
756 Set the local RTP port to @var{n}.
758 @item localrtcpport=@var{n}'
759 Set the local RTCP port to @var{n}.
761 @item pkt_size=@var{n}
762 Set max packet size (in bytes) to @var{n}.
765 Do a @code{connect()} on the UDP socket (if set to 1) or not (if set
768 @item sources=@var{ip}[,@var{ip}]
769 List allowed source IP addresses.
771 @item block=@var{ip}[,@var{ip}]
772 List disallowed (blocked) source IP addresses.
774 @item write_to_source=0|1
775 Send packets to the source address of the latest received packet (if
776 set to 1) or to a default remote address (if set to 0).
778 @item localport=@var{n}
779 Set the local RTP port to @var{n}.
781 This is a deprecated option. Instead, @option{localrtpport} should be
791 If @option{rtcpport} is not set the RTCP port will be set to the RTP
795 If @option{localrtpport} (the local RTP port) is not set any available
796 port will be used for the local RTP and RTCP ports.
799 If @option{localrtcpport} (the local RTCP port) is not set it will be
800 set to the local RTP port value plus 1.
805 Real-Time Streaming Protocol.
807 RTSP is not technically a protocol handler in libavformat, it is a demuxer
808 and muxer. The demuxer supports both normal RTSP (with data transferred
809 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
810 data transferred over RDT).
812 The muxer can be used to send a stream using RTSP ANNOUNCE to a server
813 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
814 @uref{https://github.com/revmischa/rtsp-server, RTSP server}).
816 The required syntax for a RTSP url is:
818 rtsp://@var{hostname}[:@var{port}]/@var{path}
821 Options can be set on the @command{ffmpeg}/@command{ffplay} command
822 line, or set in code via @code{AVOption}s or in
823 @code{avformat_open_input}.
825 The following options are supported.
829 Do not start playing the stream immediately if set to 1. Default value
833 Set RTSP transport protocols.
835 It accepts the following values:
838 Use UDP as lower transport protocol.
841 Use TCP (interleaving within the RTSP control channel) as lower
845 Use UDP multicast as lower transport protocol.
848 Use HTTP tunneling as lower transport protocol, which is useful for
852 Multiple lower transport protocols may be specified, in that case they are
853 tried one at a time (if the setup of one fails, the next one is tried).
854 For the muxer, only the @samp{tcp} and @samp{udp} options are supported.
859 The following values are accepted:
862 Accept packets only from negotiated peer address and port.
864 Act as a server, listening for an incoming connection.
866 Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
869 Default value is @samp{none}.
871 @item allowed_media_types
872 Set media types to accept from the server.
874 The following flags are accepted:
881 By default it accepts all media types.
884 Set minimum local UDP port. Default value is 5000.
887 Set maximum local UDP port. Default value is 65000.
890 Set maximum timeout (in seconds) to wait for incoming connections.
892 A value of -1 means infinite (default). This option implies the
893 @option{rtsp_flags} set to @samp{listen}.
895 @item reorder_queue_size
896 Set number of packets to buffer for handling of reordered packets.
899 Set socket TCP I/O timeout in microseconds.
902 Override User-Agent header. If not specified, it defaults to the
903 libavformat identifier string.
906 When receiving data over UDP, the demuxer tries to reorder received packets
907 (since they may arrive out of order, or packets may get lost totally). This
908 can be disabled by setting the maximum demuxing delay to zero (via
909 the @code{max_delay} field of AVFormatContext).
911 When watching multi-bitrate Real-RTSP streams with @command{ffplay}, the
912 streams to display can be chosen with @code{-vst} @var{n} and
913 @code{-ast} @var{n} for video and audio respectively, and can be switched
914 on the fly by pressing @code{v} and @code{a}.
918 The following examples all make use of the @command{ffplay} and
919 @command{ffmpeg} tools.
923 Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
925 ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
929 Watch a stream tunneled over HTTP:
931 ffplay -rtsp_transport http rtsp://server/video.mp4
935 Send a stream in realtime to a RTSP server, for others to watch:
937 ffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
941 Receive a stream in realtime:
943 ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
949 Session Announcement Protocol (RFC 2974). This is not technically a
950 protocol handler in libavformat, it is a muxer and demuxer.
951 It is used for signalling of RTP streams, by announcing the SDP for the
952 streams regularly on a separate port.
956 The syntax for a SAP url given to the muxer is:
958 sap://@var{destination}[:@var{port}][?@var{options}]
961 The RTP packets are sent to @var{destination} on port @var{port},
962 or to port 5004 if no port is specified.
963 @var{options} is a @code{&}-separated list. The following options
968 @item announce_addr=@var{address}
969 Specify the destination IP address for sending the announcements to.
970 If omitted, the announcements are sent to the commonly used SAP
971 announcement multicast address 224.2.127.254 (sap.mcast.net), or
972 ff0e::2:7ffe if @var{destination} is an IPv6 address.
974 @item announce_port=@var{port}
975 Specify the port to send the announcements on, defaults to
976 9875 if not specified.
979 Specify the time to live value for the announcements and RTP packets,
982 @item same_port=@var{0|1}
983 If set to 1, send all RTP streams on the same port pair. If zero (the
984 default), all streams are sent on unique ports, with each stream on a
985 port 2 numbers higher than the previous.
986 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
987 The RTP stack in libavformat for receiving requires all streams to be sent
991 Example command lines follow.
993 To broadcast a stream on the local subnet, for watching in VLC:
996 ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
999 Similarly, for watching in @command{ffplay}:
1002 ffmpeg -re -i @var{input} -f sap sap://224.0.0.255
1005 And for watching in @command{ffplay}, over IPv6:
1008 ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
1013 The syntax for a SAP url given to the demuxer is:
1015 sap://[@var{address}][:@var{port}]
1018 @var{address} is the multicast address to listen for announcements on,
1019 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{port}
1020 is the port that is listened on, 9875 if omitted.
1022 The demuxers listens for announcements on the given address and port.
1023 Once an announcement is received, it tries to receive that particular stream.
1025 Example command lines follow.
1027 To play back the first stream announced on the normal SAP multicast address:
1033 To play back the first stream announced on one the default IPv6 SAP multicast address:
1036 ffplay sap://[ff0e::2:7ffe]
1041 Stream Control Transmission Protocol.
1043 The accepted URL syntax is:
1045 sctp://@var{host}:@var{port}[?@var{options}]
1048 The protocol accepts the following options:
1051 If set to any value, listen for an incoming connection. Outgoing connection is done by default.
1054 Set the maximum number of streams. By default no limit is set.
1059 Secure Real-time Transport Protocol.
1061 The accepted options are:
1064 @item srtp_out_suite
1065 Select input and output encoding suites.
1069 @item AES_CM_128_HMAC_SHA1_80
1070 @item SRTP_AES128_CM_HMAC_SHA1_80
1071 @item AES_CM_128_HMAC_SHA1_32
1072 @item SRTP_AES128_CM_HMAC_SHA1_32
1075 @item srtp_in_params
1076 @item srtp_out_params
1077 Set input and output encoding parameters, which are expressed by a
1078 base64-encoded representation of a binary block. The first 16 bytes of
1079 this binary block are used as master key, the following 14 bytes are
1080 used as master salt.
1085 Virtually extract a segment of a file or another stream.
1086 The underlying stream must be seekable.
1091 Start offset of the extracted segment, in bytes.
1093 End offset of the extracted segment, in bytes.
1098 Extract a chapter from a DVD VOB file (start and end sectors obtained
1099 externally and multiplied by 2048):
1101 subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
1104 Play an AVI file directly from a TAR archive:
1106 subfile,,start,183241728,end,366490624,,:archive.tar
1111 Transmission Control Protocol.
1113 The required syntax for a TCP url is:
1115 tcp://@var{hostname}:@var{port}[?@var{options}]
1118 @var{options} contains a list of &-separated options of the form
1119 @var{key}=@var{val}.
1121 The list of supported options follows.
1124 @item listen=@var{1|0}
1125 Listen for an incoming connection. Default value is 0.
1127 @item timeout=@var{microseconds}
1128 Set raise error timeout, expressed in microseconds.
1130 This option is only relevant in read mode: if no data arrived in more
1131 than this time interval, raise error.
1133 @item listen_timeout=@var{milliseconds}
1134 Set listen timeout, expressed in milliseconds.
1137 The following example shows how to setup a listening TCP connection
1138 with @command{ffmpeg}, which is then accessed with @command{ffplay}:
1140 ffmpeg -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
1141 ffplay tcp://@var{hostname}:@var{port}
1146 Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
1148 The required syntax for a TLS/SSL url is:
1150 tls://@var{hostname}:@var{port}[?@var{options}]
1153 The following parameters can be set via command line options
1154 (or in code via @code{AVOption}s):
1158 @item ca_file, cafile=@var{filename}
1159 A file containing certificate authority (CA) root certificates to treat
1160 as trusted. If the linked TLS library contains a default this might not
1161 need to be specified for verification to work, but not all libraries and
1162 setups have defaults built in.
1163 The file must be in OpenSSL PEM format.
1165 @item tls_verify=@var{1|0}
1166 If enabled, try to verify the peer that we are communicating with.
1167 Note, if using OpenSSL, this currently only makes sure that the
1168 peer certificate is signed by one of the root certificates in the CA
1169 database, but it does not validate that the certificate actually
1170 matches the host name we are trying to connect to. (With GnuTLS,
1171 the host name is validated as well.)
1173 This is disabled by default since it requires a CA database to be
1174 provided by the caller in many cases.
1176 @item cert_file, cert=@var{filename}
1177 A file containing a certificate to use in the handshake with the peer.
1178 (When operating as server, in listen mode, this is more often required
1179 by the peer, while client certificates only are mandated in certain
1182 @item key_file, key=@var{filename}
1183 A file containing the private key for the certificate.
1185 @item listen=@var{1|0}
1186 If enabled, listen for connections on the provided port, and assume
1187 the server role in the handshake instead of the client role.
1191 Example command lines:
1193 To create a TLS/SSL server that serves an input stream.
1196 ffmpeg -i @var{input} -f @var{format} tls://@var{hostname}:@var{port}?listen&cert=@var{server.crt}&key=@var{server.key}
1199 To play back a stream from the TLS/SSL server using @command{ffplay}:
1202 ffplay tls://@var{hostname}:@var{port}
1207 User Datagram Protocol.
1209 The required syntax for an UDP URL is:
1211 udp://@var{hostname}:@var{port}[?@var{options}]
1214 @var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
1216 In case threading is enabled on the system, a circular buffer is used
1217 to store the incoming data, which allows one to reduce loss of data due to
1218 UDP socket buffer overruns. The @var{fifo_size} and
1219 @var{overrun_nonfatal} options are related to this buffer.
1221 The list of supported options follows.
1224 @item buffer_size=@var{size}
1225 Set the UDP maximum socket buffer size in bytes. This is used to set either
1226 the receive or send buffer size, depending on what the socket is used for.
1227 Default is 64KB. See also @var{fifo_size}.
1229 @item localport=@var{port}
1230 Override the local UDP port to bind with.
1232 @item localaddr=@var{addr}
1233 Choose the local IP address. This is useful e.g. if sending multicast
1234 and the host has multiple interfaces, where the user can choose
1235 which interface to send on by specifying the IP address of that interface.
1237 @item pkt_size=@var{size}
1238 Set the size in bytes of UDP packets.
1240 @item reuse=@var{1|0}
1241 Explicitly allow or disallow reusing UDP sockets.
1244 Set the time to live value (for multicast only).
1246 @item connect=@var{1|0}
1247 Initialize the UDP socket with @code{connect()}. In this case, the
1248 destination address can't be changed with ff_udp_set_remote_url later.
1249 If the destination address isn't known at the start, this option can
1250 be specified in ff_udp_set_remote_url, too.
1251 This allows finding out the source address for the packets with getsockname,
1252 and makes writes return with AVERROR(ECONNREFUSED) if "destination
1253 unreachable" is received.
1254 For receiving, this gives the benefit of only receiving packets from
1255 the specified peer address/port.
1257 @item sources=@var{address}[,@var{address}]
1258 Only receive packets sent to the multicast group from one of the
1259 specified sender IP addresses.
1261 @item block=@var{address}[,@var{address}]
1262 Ignore packets sent to the multicast group from the specified
1263 sender IP addresses.
1265 @item fifo_size=@var{units}
1266 Set the UDP receiving circular buffer size, expressed as a number of
1267 packets with size of 188 bytes. If not specified defaults to 7*4096.
1269 @item overrun_nonfatal=@var{1|0}
1270 Survive in case of UDP receiving circular buffer overrun. Default
1273 @item timeout=@var{microseconds}
1274 Set raise error timeout, expressed in microseconds.
1276 This option is only relevant in read mode: if no data arrived in more
1277 than this time interval, raise error.
1279 @item broadcast=@var{1|0}
1280 Explicitly allow or disallow UDP broadcasting.
1282 Note that broadcasting may not work properly on networks having
1283 a broadcast storm protection.
1286 @subsection Examples
1290 Use @command{ffmpeg} to stream over UDP to a remote endpoint:
1292 ffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port}
1296 Use @command{ffmpeg} to stream in mpegts format over UDP using 188
1297 sized UDP packets, using a large input buffer:
1299 ffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535
1303 Use @command{ffmpeg} to receive over UDP from a remote endpoint:
1305 ffmpeg -i udp://[@var{multicast-address}]:@var{port} ...
1313 The required syntax for a Unix socket URL is:
1316 unix://@var{filepath}
1319 The following parameters can be set via command line options
1320 (or in code via @code{AVOption}s):
1326 Create the Unix socket in listening mode.
1329 @c man end PROTOCOLS