summaryrefslogtreecommitdiff
authorClément Bœsch <ubitux@gmail.com>2013-05-19 15:55:19 (GMT)
committer Clément Bœsch <ubitux@gmail.com>2013-05-19 15:59:21 (GMT)
commit56f7e29dba39b2d1d8d15613622e36a1936c1aae (patch)
treec9c0ef40aeeb07c95f42443c84d1c34c3c252529
parent68c4633fa88bfcc36f5b0ae1d34dad47ce928cfe (diff)
downloadffmpeg-56f7e29dba39b2d1d8d15613622e36a1936c1aae.zip
ffmpeg-56f7e29dba39b2d1d8d15613622e36a1936c1aae.tar.gz
ffmpeg-56f7e29dba39b2d1d8d15613622e36a1936c1aae.tar.bz2
tools: add zmqshell.py.
Diffstat
-rwxr-xr-xtools/zmqshell.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/zmqshell.py b/tools/zmqshell.py
new file mode 100755
index 0000000..a7d1126
--- a/dev/null
+++ b/tools/zmqshell.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python2
+
+import sys, zmq, cmd
+
+class LavfiCmd(cmd.Cmd):
+ prompt = 'lavfi> '
+
+ def __init__(self, bind_address):
+ context = zmq.Context()
+ self.requester = context.socket(zmq.REQ)
+ self.requester.connect(bind_address)
+ cmd.Cmd.__init__(self)
+
+ def onecmd(self, cmd):
+ if cmd == 'EOF':
+ sys.exit(0)
+ print 'Sending command:[%s]' % cmd
+ self.requester.send(cmd)
+ message = self.requester.recv()
+ print 'Received reply:[%s]' % message
+
+try:
+ bind_address = sys.argv[1] if len(sys.argv) > 1 else "tcp://localhost:5555"
+ LavfiCmd(bind_address).cmdloop('FFmpeg libavfilter interactive shell')
+except KeyboardInterrupt:
+ pass