c136c74e41eacef42c913f382d7d5131ba294c29
[libav.git] / 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 tcp
659
660 Transmission Control Protocol.
661
662 The required syntax for a TCP url is:
663 @example
664 tcp://@var{hostname}:@var{port}[?@var{options}]
665 @end example
666
667 @table @option
668
669 @item listen
670 Listen for an incoming connection
671
672 @example
673 avconv -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
674 avplay tcp://@var{hostname}:@var{port}
675 @end example
676
677 @end table
678
679 @section tls
680
681 Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
682
683 The required syntax for a TLS url is:
684 @example
685 tls://@var{hostname}:@var{port}
686 @end example
687
688 The following parameters can be set via command line options
689 (or in code via @code{AVOption}s):
690
691 @table @option
692
693 @item ca_file
694 A file containing certificate authority (CA) root certificates to treat
695 as trusted. If the linked TLS library contains a default this might not
696 need to be specified for verification to work, but not all libraries and
697 setups have defaults built in.
698
699 @item tls_verify=@var{1|0}
700 If enabled, try to verify the peer that we are communicating with.
701 Note, if using OpenSSL, this currently only makes sure that the
702 peer certificate is signed by one of the root certificates in the CA
703 database, but it does not validate that the certificate actually
704 matches the host name we are trying to connect to. (With GnuTLS,
705 the host name is validated as well.)
706
707 This is disabled by default since it requires a CA database to be
708 provided by the caller in many cases.
709
710 @item cert_file
711 A file containing a certificate to use in the handshake with the peer.
712 (When operating as server, in listen mode, this is more often required
713 by the peer, while client certificates only are mandated in certain
714 setups.)
715
716 @item key_file
717 A file containing the private key for the certificate.
718
719 @item listen=@var{1|0}
720 If enabled, listen for connections on the provided port, and assume
721 the server role in the handshake instead of the client role.
722
723 @end table
724
725 @section udp
726
727 User Datagram Protocol.
728
729 The required syntax for a UDP url is:
730 @example
731 udp://@var{hostname}:@var{port}[?@var{options}]
732 @end example
733
734 @var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
735 Follow the list of supported options.
736
737 @table @option
738
739 @item buffer_size=@var{size}
740 set the UDP buffer size in bytes
741
742 @item localport=@var{port}
743 override the local UDP port to bind with
744
745 @item localaddr=@var{addr}
746 Choose the local IP address. This is useful e.g. if sending multicast
747 and the host has multiple interfaces, where the user can choose
748 which interface to send on by specifying the IP address of that interface.
749
750 @item pkt_size=@var{size}
751 set the size in bytes of UDP packets
752
753 @item reuse=@var{1|0}
754 explicitly allow or disallow reusing UDP sockets
755
756 @item ttl=@var{ttl}
757 set the time to live value (for multicast only)
758
759 @item connect=@var{1|0}
760 Initialize the UDP socket with @code{connect()}. In this case, the
761 destination address can't be changed with ff_udp_set_remote_url later.
762 If the destination address isn't known at the start, this option can
763 be specified in ff_udp_set_remote_url, too.
764 This allows finding out the source address for the packets with getsockname,
765 and makes writes return with AVERROR(ECONNREFUSED) if "destination
766 unreachable" is received.
767 For receiving, this gives the benefit of only receiving packets from
768 the specified peer address/port.
769
770 @item sources=@var{address}[,@var{address}]
771 Only receive packets sent to the multicast group from one of the
772 specified sender IP addresses.
773
774 @item block=@var{address}[,@var{address}]
775 Ignore packets sent to the multicast group from the specified
776 sender IP addresses.
777 @end table
778
779 Some usage examples of the udp protocol with @command{avconv} follow.
780
781 To stream over UDP to a remote endpoint:
782 @example
783 avconv -i @var{input} -f @var{format} udp://@var{hostname}:@var{port}
784 @end example
785
786 To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
787 @example
788 avconv -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535
789 @end example
790
791 To receive over UDP from a remote endpoint:
792 @example
793 avconv -i udp://[@var{multicast-address}]:@var{port}
794 @end example
795
796 @section unix
797
798 Unix local socket
799
800 The required syntax for a Unix socket URL is:
801
802 @example
803 unix://@var{filepath}
804 @end example
805
806 The following parameters can be set via command line options
807 (or in code via @code{AVOption}s):
808
809 @table @option
810 @item timeout
811 Timeout in ms.
812 @item listen
813 Create the Unix socket in listening mode.
814 @end table
815
816 @c man end PROTOCOLS