mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
tools: add zmqshell.py.
This commit is contained in:
parent
68c4633fa8
commit
56f7e29dba
26
tools/zmqshell.py
Executable file
26
tools/zmqshell.py
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user