]> git.sesse.net Git - ffmpeg/blob - doc/protocols.texi
Apply misc fixes spotted by Diego to protocols.texi.
[ffmpeg] / doc / protocols.texi
1 @chapter Protocols
2 @c man begin PROTOCOLS
3
4 Protocols are configured elements in FFmpeg which allow to access
5 resources which require the use of a particular protocol.
6
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".
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 ff* tools will display the list of
18 supported protocols.
19
20 A description of the currently available protocols follows.
21
22 @section concat
23
24 Physical concatenation protocol.
25
26 Allow to read and seek from many resource in sequence as if they were
27 a unique resource.
28
29 An URL accepted by this protocol has the syntax:
30 @example
31 concat:@var{URL1}|@var{URL2}|...|@var{URLN}
32 @end example
33
34 where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the
35 resource to be concatenated, each one possibly specifying a distinct
36 protocol.
37
38 For example to read a sequence of files @file{split1.mpeg},
39 @file{split2.mpeg}, @file{split3.mpeg} with @file{ffplay} use the
40 command:
41 @example
42 ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
43 @end example
44
45 Note that you may need to escape the character "|" which is special for
46 many shells.
47
48 @section file
49
50 File access protocol.
51
52 Allow to read from or read to a file.
53
54 For example to read from a file @file{input.mpeg} with @file{ffmpeg}
55 use the command:
56 @example
57 ffmpeg -i file:input.mpeg output.mpeg
58 @end example
59
60 The ff* tools default to the file protocol, that is a resource
61 specified with the name "FILE.mpeg" is interpreted as the URL
62 "file:FILE.mpeg".
63
64 @section gopher
65
66 Gopher protocol.
67
68 @section http
69
70 HTTP (Hyper Text Transfer Protocol).
71
72 @section mmst
73
74 MMS (Microsoft Media Server) protocol over TCP.
75
76 @section md5
77
78 MD5 output protocol.
79
80 Computes the MD5 hash of the data to be written, and on close writes
81 this to the designated output or stdout if none is specified. It can
82 be used to test muxers without writing an actual file.
83
84 Some examples follow.
85 @example
86 # Write the MD5 hash of the encoded AVI file in the file output.avi.md5.
87 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
88
89 # Write the MD5 hash of the encoded AVI file to stdout.
90 ffmpeg -i input.flv -f avi -y md5:
91 @end example
92
93 Note that some formats (typically MOV) require the output protocol to
94 be seekable, so they will fail with the MD5 output protocol.
95
96 @section pipe
97
98 UNIX pipe access protocol.
99
100 Allow to read and write from UNIX pipes.
101
102 The accepted syntax is:
103 @example
104 pipe:[@var{number}]
105 @end example
106
107 @var{number} is the number corresponding to the file descriptor of the
108 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If @var{number}
109 is not specified, by default the stdout file descriptor will be used
110 for writing, stdin for reading.
111
112 For example to read from stdin with @file{ffmpeg}:
113 @example
114 cat test.wav | ffmpeg -i pipe:0
115 # ...this is the same as...
116 cat test.wav | ffmpeg -i pipe:
117 @end example
118
119 For writing to stdout with @file{ffmpeg}:
120 @example
121 ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
122 # ...this is the same as...
123 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
124 @end example
125
126 Note that some formats (typically MOV), require the output protocol to
127 be seekable, so they will fail with the pipe output protocol.
128
129 @section rtmp
130
131 Real-Time Messaging Protocol.
132
133 The Real-Time Messaging Protocol (RTMP) is used for streaming multimeā€
134 dia content across a TCP/IP network.
135
136 The required syntax is:
137 @example
138 rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
139 @end example
140
141 The accepted parameters are:
142 @table @option
143
144 @item server
145 The address of the RTMP server.
146
147 @item port
148 The number of the TCP port to use (by default is 1935).
149
150 @item app
151 It is the name of the application to access. It usually corresponds to
152 the path where the application is installed on the RTMP server
153 (e.g. @file{/ondemand/}, @file{/flash/live/}, etc.).
154
155 @item playpath
156 It is the path or name of the resource to play with reference to the
157 application specified in @var{app}, may be prefixed by "mp4:".
158
159 @end table
160
161 For example to read with @file{ffplay} a multimedia resource named
162 "sample" from the application "vod" from an RTMP server "myserver":
163 @example
164 ffplay rtmp://myserver/vod/sample
165 @end example
166
167 @section rtmp, rtmpe, rtmps, rtmpt, rtmpte
168
169 Real-Time Messaging Protocol and its variants supported through
170 librtmp.
171
172 Requires the presence of the librtmp headers and library during
173 configuration. You need to explicitely configure the build with
174 "--enable-librtmp". If enabled this will replace the native RTMP
175 protocol.
176
177 This protocol provides most client functions and a few server
178 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
179 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
180 variants of these encrypted types (RTMPTE, RTMPTS).
181
182 The required syntax is:
183 @example
184 @var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options}
185 @end example
186
187 where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe",
188 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
189 @var{server}, @var{port}, @var{app} and @var{playpath} have the same
190 meaning as specified for the RTMP native protocol.
191 @var{options} contains a list of space-separated options of the form
192 @var{key}=@var{val}.
193
194 See the librtmp manual page (man 3 librtmp) for more information.
195
196 For example, to stream a file in real-time to an RTMP server using
197 @file{ffmpeg}:
198 @example
199 ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
200 @end example
201
202 To play the same stream using @file{ffplay}:
203 @example
204 ffplay "rtmp://myserver/live/mystream live=1"
205 @end example
206
207 @section rtp
208
209 Real-Time Protocol.
210
211 @section tcp
212
213 Trasmission Control Protocol.
214
215 @section udp
216
217 User Datagram Protocol.
218
219 @c man end PROTOCOLS