3

I have written a small function like this:

def test():
    command = "ffmpeg -f mpegts -i udp://224.6.207.111:1234?multicast=1 -acodec copy -vcodec copy -sameq ff-output.ts"
    os.system(command)
    self.myTimer = Timer(10, "myTimer")
    self.myTimer.start()
    os.system(signal.SIGINT)
    self.myTimer.stop()

When i run test() in python in my terminal, ffmpeg always continues without closing. Does someone know how to stop it?

Thank you for all comment ;D I have find that we can use -t option for ffmpeg :)

  • 1
    `os.system(command)` waits for the command to complete, and `os.system(signal.SIGINT)` isn't how you send signals. [`os.kill`](https://docs.python.org/2/library/os.html#os.kill) sends signals. – user2357112 Jul 30 '14 at 08:47
  • 2
    This thread should hold the answer for you. http://stackoverflow.com/questions/636561/how-can-i-run-an-external-command-asynchronously-from-python – Pablo Jomer Jul 30 '14 at 08:52

0 Answers0