mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-16 03:42:35 +03:00
754f9336f0
git-svn-id: svn://kolibrios.org@4349 a494cfbc-eb01-0410-851d-a64ba20cac60
27 lines
725 B
Python
27 lines
725 B
Python
#!/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
|