[FFmpeg-cvslog] tools: add zmqshell.py.
Clément Bœsch
git at videolan.org
Sun May 19 17:59:44 CEST 2013
ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun May 19 17:55:19 2013 +0200| [56f7e29dba39b2d1d8d15613622e36a1936c1aae] | committer: Clément Bœsch
tools: add zmqshell.py.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=56f7e29dba39b2d1d8d15613622e36a1936c1aae
---
tools/zmqshell.py | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tools/zmqshell.py b/tools/zmqshell.py
new file mode 100755
index 0000000..a7d1126
--- /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
More information about the ffmpeg-cvslog
mailing list