summaryrefslogtreecommitdiff
path: root/doc/protocols.texi
diff options
context:
space:
mode:
authorAndriy Gelman <andriy.gelman@gmail.com>2019-07-30 14:39:32 -0400
committerMarton Balint <cus@passwd.hu>2019-09-02 23:08:43 +0200
commitef43a4d6b38de941dd2ede0711d4fd5d811127ed (patch)
treecd9bd40e04c73631c873560139862f7d070186d0 /doc/protocols.texi
parentb022d9ba288ad3de321e0835b0aedfd91c2c3064 (diff)
avformat: Add ZeroMQ as a protocol
When ffmpeg was streaming, multiple clients were only supported by using a multicast destination address. An alternative was to stream to a server which re-distributes the content. This commit adds ZeroMQ as a protocol, which allows multiple clients to connect to a single ffmpeg instance. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'doc/protocols.texi')
-rw-r--r--doc/protocols.texi47
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/protocols.texi b/doc/protocols.texi
index 3e4e7af3d4..b03432e3e5 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -1728,4 +1728,51 @@ Timeout in ms.
Create the Unix socket in listening mode.
@end table
+@section zmq
+
+ZeroMQ asynchronous messaging using the libzmq library.
+
+This library supports unicast streaming to multiple clients without relying on
+an external server.
+
+The required syntax for streaming or connecting to a stream is:
+@example
+zmq:tcp://ip-address:port
+@end example
+
+Example:
+Create a localhost stream on port 5555:
+@example
+ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
+@end example
+
+Multiple clients may connect to the stream using:
+@example
+ffplay zmq:tcp://127.0.0.1:5555
+@end example
+
+Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
+The server side binds to a port and publishes data. Clients connect to the
+server (via IP address/port) and subscribe to the stream. The order in which
+the server and client start generally does not matter.
+
+ffmpeg must be compiled with the --enable-libzmq option to support
+this protocol.
+
+Options can be set on the @command{ffmpeg}/@command{ffplay} command
+line. The following options are supported:
+
+@table @option
+
+@item pkt_size
+Forces the maximum packet size for sending/receiving data. The default value is
+32,768 bytes. On the server side, this sets the maximum size of sent packets
+via ZeroMQ. On the clients, it sets an internal buffer size for receiving
+packets. Note that pkt_size on the clients should be equal to or greater than
+pkt_size on the server. Otherwise the received message may be truncated causing
+decoding errors.
+
+@end table
+
+
@c man end PROTOCOLS