]> git.sesse.net Git - ffmpeg/blob - doc/protocols.texi
e2d06a067535dce8ad53cb5a25ea4e32db5c9ea1
[ffmpeg] / doc / protocols.texi
1 @chapter Protocols
2 @c man begin PROTOCOLS
3
4 Protocols are configured elements in Libav which allow to access
5 resources which require the use of a particular protocol.
6
7 When you configure your Libav build, all the supported protocols are
8 enabled by default. You can list all available ones using the
9 configure option "--list-protocols".
10
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}".
16
17 The option "-protocols" of the av* tools will display the list of
18 supported protocols.
19
20 All protocols accept the following options:
21
22 @table @option
23 @item rw_timeout
24 Maximum time to wait for (network) read/write operations to complete,
25 in microseconds.
26 @end table
27
28 A description of the currently available protocols follows.
29
30 @section concat
31
32 Physical concatenation protocol.
33
34 Allow to read and seek from many resource in sequence as if they were
35 a unique resource.
36
37 A URL accepted by this protocol has the syntax:
38 @example
39 concat:@var{URL1}|@var{URL2}|...|@var{URLN}
40 @end example
41
42 where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the
43 resource to be concatenated, each one possibly specifying a distinct
44 protocol.
45
46 For example to read a sequence of files @file{split1.mpeg},
47 @file{split2.mpeg}, @file{split3.mpeg} with @command{avplay} use the
48 command:
49 @example
50 avplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
51 @end example
52
53 Note that you may need to escape the character "|" which is special for
54 many shells.
55
56 @section file
57
58 File access protocol.
59
60 Allow to read from or read to a file.
61
62 For example to read from a file @file{input.mpeg} with @command{avconv}
63 use the command:
64 @example
65 avconv -i file:input.mpeg output.mpeg
66 @end example
67
68 The av* tools default to the file protocol, that is a resource
69 specified with the name "FILE.mpeg" is interpreted as the URL
70 "file:FILE.mpeg".
71
72 This protocol accepts the following options:
73
74 @table @option
75 @item follow
76 If set to 1, the protocol will retry reading at the end of the file, allowing
77 reading files that still are being written. In order for this to terminate,
78 you either need to use the rw_timeout option, or use the interrupt callback
79 (for API users).
80
81 @end table
82
83 @section gopher
84
85 Gopher protocol.
86
87 @section hls
88
89 Read Apple HTTP Live Streaming compliant segmented stream as
90 a uniform one. The M3U8 playlists describing the segments can be
91 remote HTTP resources or local files, accessed using the standard
92 file protocol.
93 The nested protocol is declared by specifying
94 "+@var{proto}" after the hls URI scheme name, where @var{proto}
95 is either "file" or "http".
96
97 @example
98 hls+http://host/path/to/remote/resource.m3u8
99 hls+file://path/to/local/resource.m3u8
100 @end example
101
102 Using this protocol is discouraged - the hls demuxer should work
103 just as well (if not, please report the issues) and is more complete.
104 To use the hls demuxer instead, simply use the direct URLs to the
105 m3u8 files.
106
107 @section http
108
109 HTTP (Hyper Text Transfer Protocol).
110
111 This protocol accepts the following options:
112
113 @table @option
114 @item chunked_post
115 If set to 1 use chunked Transfer-Encoding for posts, default is 1.
116
117 @item content_type
118 Set a specific content type for the POST messages.
119
120 @item headers
121 Set custom HTTP headers, can override built in default headers. The
122 value must be a string encoding the headers.
123
124 @item multiple_requests
125 Use persistent connections if set to 1, default is 0.
126
127 @item post_data
128 Set custom HTTP post data.
129
130 @item user_agent
131 Override the User-Agent header. If not specified a string of the form
132 "Lavf/<version>" will be used.
133
134 @item mime_type
135 Export the MIME type.
136
137 @item icy
138 If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
139 supports this, the metadata has to be retrieved by the application by reading
140 the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
141 The default is 1.
142
143 @item icy_metadata_headers
144 If the server supports ICY metadata, this contains the ICY-specific HTTP reply
145 headers, separated by newline characters.
146
147 @item icy_metadata_packet
148 If the server supports ICY metadata, and @option{icy} was set to 1, this
149 contains the last non-empty metadata packet sent by the server. It should be
150 polled in regular intervals by applications interested in mid-stream metadata
151 updates.
152
153 @item offset
154 Set initial byte offset.
155
156 @item end_offset
157 Try to limit the request to bytes preceding this offset.
158 @end table
159
160 @section Icecast
161
162 Icecast (stream to Icecast servers)
163
164 This protocol accepts the following options:
165
166 @table @option
167 @item ice_genre
168 Set the stream genre.
169
170 @item ice_name
171 Set the stream name.
172
173 @item ice_description
174 Set the stream description.
175
176 @item ice_url
177 Set the stream website URL.
178
179 @item ice_public
180 Set if the stream should be public or not.
181 The default is 0 (not public).
182
183 @item user_agent
184 Override the User-Agent header. If not specified a string of the form
185 "Lavf/<version>" will be used.
186
187 @item password
188 Set the Icecast mountpoint password.
189
190 @item content_type
191 Set the stream content type. This must be set if it is different from
192 audio/mpeg.
193
194 @item legacy_icecast
195 This enables support for Icecast versions < 2.4.0, that do not support the
196 HTTP PUT method but the SOURCE method.
197
198 @end table
199
200 @section mmst
201
202 MMS (Microsoft Media Server) protocol over TCP.
203
204 @section mmsh
205
206 MMS (Microsoft Media Server) protocol over HTTP.
207
208 The required syntax is:
209 @example
210 mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
211 @end example
212
213 @section md5
214
215 MD5 output protocol.
216
217 Computes the MD5 hash of the data to be written, and on close writes
218 this to the designated output or stdout if none is specified. It can
219 be used to test muxers without writing an actual file.
220
221 Some examples follow.
222 @example
223 # Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
224 avconv -i input.flv -f avi -y md5:output.avi.md5
225
226 # Write the MD5 hash of the encoded AVI file to stdout.
227 avconv -i input.flv -f avi -y md5:
228 @end example
229
230 Note that some formats (typically MOV) require the output protocol to
231 be seekable, so they will fail with the MD5 output protocol.
232
233 @section pipe
234
235 UNIX pipe access protocol.
236
237 Allow to read and write from UNIX pipes.
238
239 The accepted syntax is:
240 @example
241 pipe:[@var{number}]
242 @end example
243
244 @var{number} is the number corresponding to the file descriptor of the
245 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If @var{number}
246 is not specified, by default the stdout file descriptor will be used
247 for writing, stdin for reading.
248
249 For example to read from stdin with @command{avconv}:
250 @example
251 cat test.wav | avconv -i pipe:0
252 # ...this is the same as...
253 cat test.wav | avconv -i pipe:
254 @end example
255
256 For writing to stdout with @command{avconv}:
257 @example
258 avconv -i test.wav -f avi pipe:1 | cat > test.avi
259 # ...this is the same as...
260 avconv -i test.wav -f avi pipe: | cat > test.avi
261 @end example
262
263 Note that some formats (typically MOV), require the output protocol to
264 be seekable, so they will fail with the pipe output protocol.
265
266 @section rtmp
267
268 Real-Time Messaging Protocol.
269
270 The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
271 content across a TCP/IP network.
272
273 The required syntax is:
274 @example
275 rtmp://[@var{username}:@var{password}@@]@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
276 @end example
277
278 The accepted parameters are:
279 @table @option
280
281 @item username
282 An optional username (mostly for publishing).
283
284 @item password
285 An optional password (mostly for publishing).
286
287 @item server
288 The address of the RTMP server.
289
290 @item port
291 The number of the TCP port to use (by default is 1935).
292
293 @item app
294 It is the name of the application to access. It usually corresponds to
295 the path where the application is installed on the RTMP server
296 (e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). You can override
297 the value parsed from the URI through the @code{rtmp_app} option, too.
298
299 @item playpath
300 It is the path or name of the resource to play with reference to the
301 application specified in @var{app}, may be prefixed by "mp4:". You
302 can override the value parsed from the URI through the @code{rtmp_playpath}
303 option, too.
304
305 @item listen
306 Act as a server, listening for an incoming connection.
307
308 @item timeout
309 Maximum time to wait for the incoming connection. Implies listen.
310 @end table
311
312 Additionally, the following parameters can be set via command line options
313 (or in code via @code{AVOption}s):
314 @table @option
315
316 @item rtmp_app
317 Name of application to connect on the RTMP server. This option
318 overrides the parameter specified in the URI.
319
320 @item rtmp_buffer
321 Set the client buffer time in milliseconds. The default is 3000.
322
323 @item rtmp_conn
324 Extra arbitrary AMF connection parameters, parsed from a string,
325 e.g. like @code{B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0}.
326 Each value is prefixed by a single character denoting the type,
327 B for Boolean, N for number, S for string, O for object, or Z for null,
328 followed by a colon. For Booleans the data must be either 0 or 1 for
329 FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
330 1 to end or begin an object, respectively. Data items in subobjects may
331 be named, by prefixing the type with 'N' and specifying the name before
332 the value (i.e. @code{NB:myFlag:1}). This option may be used multiple
333 times to construct arbitrary AMF sequences.
334
335 @item rtmp_flashver
336 Version of the Flash plugin used to run the SWF player. The default
337 is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
338 <libavformat version>).)
339
340 @item rtmp_flush_interval
341 Number of packets flushed in the same request (RTMPT only). The default
342 is 10.
343
344 @item rtmp_live
345 Specify that the media is a live stream. No resuming or seeking in
346 live streams is possible. The default value is @code{any}, which means the
347 subscriber first tries to play the live stream specified in the
348 playpath. If a live stream of that name is not found, it plays the
349 recorded stream. The other possible values are @code{live} and
350 @code{recorded}.
351
352 @item rtmp_pageurl
353 URL of the web page in which the media was embedded. By default no
354 value will be sent.
355
356 @item rtmp_playpath
357 Stream identifier to play or to publish. This option overrides the
358 parameter specified in the URI.
359
360 @item rtmp_subscribe
361 Name of live stream to subscribe to. By default no value will be sent.
362 It is only sent if the option is specified or if rtmp_live
363 is set to live.
364
365 @item rtmp_swfhash
366 SHA256 hash of the decompressed SWF file (32 bytes).
367
368 @item rtmp_swfsize
369 Size of the decompressed SWF file, required for SWFVerification.
370
371 @item rtmp_swfurl
372 URL of the SWF player for the media. By default no value will be sent.
373
374 @item rtmp_swfverify
375 URL to player swf file, compute hash/size automatically.
376
377 @item rtmp_tcurl
378 URL of the target stream. Defaults to proto://host[:port]/app.
379
380 @end table
381
382 For example to read with @command{avplay} a multimedia resource named
383 "sample" from the application "vod" from an RTMP server "myserver":
384 @example
385 avplay rtmp://myserver/vod/sample
386 @end example
387
388 To publish to a password protected server, passing the playpath and
389 app names separately:
390 @example
391 avconv -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@@myserver/
392 @end example
393
394 @section rtmpe
395
396 Encrypted Real-Time Messaging Protocol.
397
398 The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
399 streaming multimedia content within standard cryptographic primitives,
400 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
401 a pair of RC4 keys.
402
403 @section rtmps
404
405 Real-Time Messaging Protocol over a secure SSL connection.
406
407 The Real-Time Messaging Protocol (RTMPS) is used for streaming
408 multimedia content across an encrypted connection.
409
410 @section rtmpt
411
412 Real-Time Messaging Protocol tunneled through HTTP.
413
414 The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
415 for streaming multimedia content within HTTP requests to traverse
416 firewalls.
417
418 @section rtmpte
419
420 Encrypted Real-Time Messaging Protocol tunneled through HTTP.
421
422 The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
423 is used for streaming multimedia content within HTTP requests to traverse
424 firewalls.
425
426 @section rtmpts
427
428 Real-Time Messaging Protocol tunneled through HTTPS.
429
430 The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
431 for streaming multimedia content within HTTPS requests to traverse
432 firewalls.
433
434 @section librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte
435
436 Real-Time Messaging Protocol and its variants supported through
437 librtmp.
438
439 Requires the presence of the librtmp headers and library during
440 configuration. You need to explicitly configure the build with
441 "--enable-librtmp". If enabled this will replace the native RTMP
442 protocol.
443
444 This protocol provides most client functions and a few server
445 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
446 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
447 variants of these encrypted types (RTMPTE, RTMPTS).
448
449 The required syntax is:
450 @example
451 @var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options}
452 @end example
453
454 where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe",
455 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
456 @var{server}, @var{port}, @var{app} and @var{playpath} have the same
457 meaning as specified for the RTMP native protocol.
458 @var{options} contains a list of space-separated options of the form
459 @var{key}=@var{val}.
460
461 See the librtmp manual page (man 3 librtmp) for more information.
462
463 For example, to stream a file in real-time to an RTMP server using
464 @command{avconv}:
465 @example
466 avconv -re -i myfile -f flv rtmp://myserver/live/mystream
467 @end example
468
469 To play the same stream using @command{avplay}:
470 @example
471 avplay "rtmp://myserver/live/mystream live=1"
472 @end example
473
474 @section rtp
475
476 Real-Time Protocol.
477
478 @section rtsp
479
480 RTSP is not technically a protocol handler in libavformat, it is a demuxer
481 and muxer. The demuxer supports both normal RTSP (with data transferred
482 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
483 data transferred over RDT).
484
485 The muxer can be used to send a stream using RTSP ANNOUNCE to a server
486 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
487 @uref{http://github.com/revmischa/rtsp-server, RTSP server}).
488
489 The required syntax for a RTSP url is:
490 @example
491 rtsp://@var{hostname}[:@var{port}]/@var{path}
492 @end example
493
494 The following options (set on the @command{avconv}/@command{avplay} command
495 line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
496 are supported:
497
498 Flags for @code{rtsp_transport}:
499
500 @table @option
501
502 @item udp
503 Use UDP as lower transport protocol.
504
505 @item tcp
506 Use TCP (interleaving within the RTSP control channel) as lower
507 transport protocol.
508
509 @item udp_multicast
510 Use UDP multicast as lower transport protocol.
511
512 @item http
513 Use HTTP tunneling as lower transport protocol, which is useful for
514 passing proxies.
515 @end table
516
517 Multiple lower transport protocols may be specified, in that case they are
518 tried one at a time (if the setup of one fails, the next one is tried).
519 For the muxer, only the @code{tcp} and @code{udp} options are supported.
520
521 Flags for @code{rtsp_flags}:
522
523 @table @option
524 @item filter_src
525 Accept packets only from negotiated peer address and port.
526 @item listen
527 Act as a server, listening for an incoming connection.
528 @end table
529
530 When receiving data over UDP, the demuxer tries to reorder received packets
531 (since they may arrive out of order, or packets may get lost totally). This
532 can be disabled by setting the maximum demuxing delay to zero (via
533 the @code{max_delay} field of AVFormatContext).
534
535 When watching multi-bitrate Real-RTSP streams with @command{avplay}, the
536 streams to display can be chosen with @code{-vst} @var{n} and
537 @code{-ast} @var{n} for video and audio respectively, and can be switched
538 on the fly by pressing @code{v} and @code{a}.
539
540 Example command lines:
541
542 To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
543
544 @example
545 avplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
546 @end example
547
548 To watch a stream tunneled over HTTP:
549
550 @example
551 avplay -rtsp_transport http rtsp://server/video.mp4
552 @end example
553
554 To send a stream in realtime to a RTSP server, for others to watch:
555
556 @example
557 avconv -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
558 @end example
559
560 To receive a stream in realtime:
561
562 @example
563 avconv -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
564 @end example
565
566 @section sap
567
568 Session Announcement Protocol (RFC 2974). This is not technically a
569 protocol handler in libavformat, it is a muxer and demuxer.
570 It is used for signalling of RTP streams, by announcing the SDP for the
571 streams regularly on a separate port.
572
573 @subsection Muxer
574
575 The syntax for a SAP url given to the muxer is:
576 @example
577 sap://@var{destination}[:@var{port}][?@var{options}]
578 @end example
579
580 The RTP packets are sent to @var{destination} on port @var{port},
581 or to port 5004 if no port is specified.
582 @var{options} is a @code{&}-separated list. The following options
583 are supported:
584
585 @table @option
586
587 @item announce_addr=@var{address}
588 Specify the destination IP address for sending the announcements to.
589 If omitted, the announcements are sent to the commonly used SAP
590 announcement multicast address 224.2.127.254 (sap.mcast.net), or
591 ff0e::2:7ffe if @var{destination} is an IPv6 address.
592
593 @item announce_port=@var{port}
594 Specify the port to send the announcements on, defaults to
595 9875 if not specified.
596
597 @item ttl=@var{ttl}
598 Specify the time to live value for the announcements and RTP packets,
599 defaults to 255.
600
601 @item same_port=@var{0|1}
602 If set to 1, send all RTP streams on the same port pair. If zero (the
603 default), all streams are sent on unique ports, with each stream on a
604 port 2 numbers higher than the previous.
605 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
606 The RTP stack in libavformat for receiving requires all streams to be sent
607 on unique ports.
608 @end table
609
610 Example command lines follow.
611
612 To broadcast a stream on the local subnet, for watching in VLC:
613
614 @example
615 avconv -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
616 @end example
617
618 Similarly, for watching in avplay:
619
620 @example
621 avconv -re -i @var{input} -f sap sap://224.0.0.255
622 @end example
623
624 And for watching in avplay, over IPv6:
625
626 @example
627 avconv -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
628 @end example
629
630 @subsection Demuxer
631
632 The syntax for a SAP url given to the demuxer is:
633 @example
634 sap://[@var{address}][:@var{port}]
635 @end example
636
637 @var{address} is the multicast address to listen for announcements on,
638 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{port}
639 is the port that is listened on, 9875 if omitted.
640
641 The demuxers listens for announcements on the given address and port.
642 Once an announcement is received, it tries to receive that particular stream.
643
644 Example command lines follow.
645
646 To play back the first stream announced on the normal SAP multicast address:
647
648 @example
649 avplay sap://
650 @end example
651
652 To play back the first stream announced on one the default IPv6 SAP multicast address:
653
654 @example
655 avplay sap://[ff0e::2:7ffe]
656 @end example
657
658 @section srt
659
660 Haivision Secure Reliable Transport Protocol via libsrt.
661
662 The supported syntax for a SRT URL is:
663 @example
664 srt://@var{hostname}:@var{port}[?@var{options}]
665 @end example
666
667 @var{options} contains a list of &-separated options of the form
668 @var{key}=@var{val}.
669
670 or
671
672 @example
673 @var{options} srt://@var{hostname}:@var{port}
674 @end example
675
676 @var{options} contains a list of '-@var{key} @var{val}'
677 options.
678
679 This protocol accepts the following options.
680
681 @table @option
682 @item connect_timeout
683 Connection timeout; SRT cannot connect for RTT > 1500 msec
684 (2 handshake exchanges) with the default connect timeout of
685 3 seconds. This option applies to the caller and rendezvous
686 connection modes. The connect timeout is 10 times the value
687 set for the rendezvous mode (which can be used as a
688 workaround for this connection problem with earlier versions).
689
690 @item ffs=@var{bytes}
691 Flight Flag Size (Window Size), in bytes. FFS is actually an
692 internal parameter and you should set it to not less than
693 @option{recv_buffer_size} and @option{mss}. The default value
694 is relatively large, therefore unless you set a very large receiver buffer,
695 you do not need to change this option. Default value is 25600.
696
697 @item inputbw=@var{bytes/seconds}
698 Sender nominal input rate, in bytes per seconds. Used along with
699 @option{oheadbw}, when @option{maxbw} is set to relative (0), to
700 calculate maximum sending rate when recovery packets are sent
701 along with the main media stream:
702 @option{inputbw} * (100 + @option{oheadbw}) / 100
703 if @option{inputbw} is not set while @option{maxbw} is set to
704 relative (0), the actual input rate is evaluated inside
705 the library. Default value is 0.
706
707 @item iptos=@var{tos}
708 IP Type of Service. Applies to sender only. Default value is 0xB8.
709
710 @item ipttl=@var{ttl}
711 IP Time To Live. Applies to sender only. Default value is 64.
712
713 @item listen_timeout
714 Set socket listen timeout.
715
716 @item maxbw=@var{bytes/seconds}
717 Maximum sending bandwidth, in bytes per seconds.
718 -1 infinite (CSRTCC limit is 30mbps)
719 0 relative to input rate (see @option{inputbw})
720 >0 absolute limit value
721 Default value is 0 (relative)
722
723 @item mode=@var{caller|listener|rendezvous}
724 Connection mode.
725 @option{caller} opens client connection.
726 @option{listener} starts server to listen for incoming connections.
727 @option{rendezvous} use Rendez-Vous connection mode.
728 Default value is caller.
729
730 @item mss=@var{bytes}
731 Maximum Segment Size, in bytes. Used for buffer allocation
732 and rate calculation using a packet counter assuming fully
733 filled packets. The smallest MSS between the peers is
734 used. This is 1500 by default in the overall internet.
735 This is the maximum size of the UDP packet and can be
736 only decreased, unless you have some unusual dedicated
737 network settings. Default value is 1500.
738
739 @item nakreport=@var{1|0}
740 If set to 1, Receiver will send `UMSG_LOSSREPORT` messages
741 periodically until a lost packet is retransmitted or
742 intentionally dropped. Default value is 1.
743
744 @item oheadbw=@var{percents}
745 Recovery bandwidth overhead above input rate, in percents.
746 See @option{inputbw}. Default value is 25%.
747
748 @item passphrase=@var{string}
749 HaiCrypt Encryption/Decryption Passphrase string, length
750 from 10 to 79 characters. The passphrase is the shared
751 secret between the sender and the receiver. It is used
752 to generate the Key Encrypting Key using PBKDF2
753 (Password-Based Key Derivation Function). It is used
754 only if @option{pbkeylen} is non-zero. It is used on
755 the receiver only if the received data is encrypted.
756 The configured passphrase cannot be recovered (write-only).
757
758 @item pbkeylen=@var{bytes}
759 Sender encryption key length, in bytes.
760 Only can be set to 0, 16, 24 and 32.
761 Enable sender encryption if not 0.
762 Not required on receiver (set to 0),
763 key size obtained from sender in HaiCrypt handshake.
764 Default value is 0.
765
766 @item recv_buffer_size=@var{bytes}
767 Set receive buffer size, expressed in bytes.
768
769 @item send_buffer_size=@var{bytes}
770 Set send buffer size, expressed in bytes.
771
772 @item rw_timeout
773 Set raise error timeout for read/write optations.
774
775 This option is only relevant in read mode:
776 if no data arrived in more than this time
777 interval, raise error.
778
779 @item tlpktdrop=@var{1|0}
780 Too-late Packet Drop. When enabled on receiver, it skips
781 missing packets that have not been delivered in time and
782 delivers the following packets to the application when
783 their time-to-play has come. It also sends a fake ACK to
784 the sender. When enabled on sender and enabled on the
785 receiving peer, the sender drops the older packets that
786 have no chance of being delivered in time. It was
787 automatically enabled in the sender if the receiver
788 supports it.
789
790 @item tsbpddelay
791 Timestamp-based Packet Delivery Delay.
792 Used to absorb burst of missed packet retransmission.
793
794 @end table
795
796 For more information see: @url{https://github.com/Haivision/srt}.
797
798 @section tcp
799
800 Transmission Control Protocol.
801
802 The required syntax for a TCP url is:
803 @example
804 tcp://@var{hostname}:@var{port}[?@var{options}]
805 @end example
806
807 @table @option
808
809 @item listen
810 Listen for an incoming connection
811
812 @example
813 avconv -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
814 avplay tcp://@var{hostname}:@var{port}
815 @end example
816
817 @end table
818
819 @section tls
820
821 Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
822
823 The required syntax for a TLS url is:
824 @example
825 tls://@var{hostname}:@var{port}
826 @end example
827
828 The following parameters can be set via command line options
829 (or in code via @code{AVOption}s):
830
831 @table @option
832
833 @item ca_file
834 A file containing certificate authority (CA) root certificates to treat
835 as trusted. If the linked TLS library contains a default this might not
836 need to be specified for verification to work, but not all libraries and
837 setups have defaults built in.
838
839 @item tls_verify=@var{1|0}
840 If enabled, try to verify the peer that we are communicating with.
841 Note, if using OpenSSL, this currently only makes sure that the
842 peer certificate is signed by one of the root certificates in the CA
843 database, but it does not validate that the certificate actually
844 matches the host name we are trying to connect to. (With GnuTLS,
845 the host name is validated as well.)
846
847 This is disabled by default since it requires a CA database to be
848 provided by the caller in many cases.
849
850 @item cert_file
851 A file containing a certificate to use in the handshake with the peer.
852 (When operating as server, in listen mode, this is more often required
853 by the peer, while client certificates only are mandated in certain
854 setups.)
855
856 @item key_file
857 A file containing the private key for the certificate.
858
859 @item listen=@var{1|0}
860 If enabled, listen for connections on the provided port, and assume
861 the server role in the handshake instead of the client role.
862
863 @end table
864
865 @section udp
866
867 User Datagram Protocol.
868
869 The required syntax for a UDP url is:
870 @example
871 udp://@var{hostname}:@var{port}[?@var{options}]
872 @end example
873
874 @var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
875 Follow the list of supported options.
876
877 @table @option
878
879 @item buffer_size=@var{size}
880 set the UDP buffer size in bytes
881
882 @item localport=@var{port}
883 override the local UDP port to bind with
884
885 @item localaddr=@var{addr}
886 Choose the local IP address. This is useful e.g. if sending multicast
887 and the host has multiple interfaces, where the user can choose
888 which interface to send on by specifying the IP address of that interface.
889
890 @item pkt_size=@var{size}
891 set the size in bytes of UDP packets
892
893 @item reuse=@var{1|0}
894 explicitly allow or disallow reusing UDP sockets
895
896 @item ttl=@var{ttl}
897 set the time to live value (for multicast only)
898
899 @item connect=@var{1|0}
900 Initialize the UDP socket with @code{connect()}. In this case, the
901 destination address can't be changed with ff_udp_set_remote_url later.
902 If the destination address isn't known at the start, this option can
903 be specified in ff_udp_set_remote_url, too.
904 This allows finding out the source address for the packets with getsockname,
905 and makes writes return with AVERROR(ECONNREFUSED) if "destination
906 unreachable" is received.
907 For receiving, this gives the benefit of only receiving packets from
908 the specified peer address/port.
909
910 @item sources=@var{address}[,@var{address}]
911 Only receive packets sent to the multicast group from one of the
912 specified sender IP addresses.
913
914 @item block=@var{address}[,@var{address}]
915 Ignore packets sent to the multicast group from the specified
916 sender IP addresses.
917 @end table
918
919 Some usage examples of the udp protocol with @command{avconv} follow.
920
921 To stream over UDP to a remote endpoint:
922 @example
923 avconv -i @var{input} -f @var{format} udp://@var{hostname}:@var{port}
924 @end example
925
926 To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
927 @example
928 avconv -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535
929 @end example
930
931 To receive over UDP from a remote endpoint:
932 @example
933 avconv -i udp://[@var{multicast-address}]:@var{port}
934 @end example
935
936 @section unix
937
938 Unix local socket
939
940 The required syntax for a Unix socket URL is:
941
942 @example
943 unix://@var{filepath}
944 @end example
945
946 The following parameters can be set via command line options
947 (or in code via @code{AVOption}s):
948
949 @table @option
950 @item timeout
951 Timeout in ms.
952 @item listen
953 Create the Unix socket in listening mode.
954 @end table
955
956 @c man end PROTOCOLS