1

I'm trying to run ffmpeg on a lambda function. I'm using a Python 2.7 environment. I'm using the latest static build from https://johnvansickle.com/ffmpeg/. The ffmpeg binary is copied into the tmp directory and chmodded to 555.

I'm running the following command:

subprocess.check_output(["/tmp/ffmpeg", "-r", "24","-i", "/tmp/"+background['video'], "-i", location+"%08d.png","-i", "/tmp/"+background['audio'],"-filter_complex", "'[0:v][1:v]overlay'","-shortest","-c:v", "libx264", "-vf","fps=24", "-pix_fmt", "yuv420p", "/tmp/output.mp4"])

I'm getting the error:

AVFilterGraph @ 0x5b3b1c0] No such filter: '[0:v][1:v]overlay'

I saw about adding stdin=subprocess.DEVNULL here but I can't work out how, and if that would help in this instance.

Does anyone have any other suggestions?

Thanks in advance.

Mike

MikeCoverUps
  • 723
  • 3
  • 10
  • 19
  • 1
    Probably a quoting issue. – llogan Feb 21 '19 at 18:01
  • Thanks for the thought. I've tried single, double and no quotes around the overlay section. Anything else I should try? – MikeCoverUps Feb 22 '19 at 12:31
  • I'm not a python user, so I can't help much with that part. If you show the actual ffmepg command being executed I may see something. Unrelated to the exact issue at hand, but you can't use `-filter_complex` and `-vf` for the same stream or you will get an error telling you this. So do all of the filtering in one filtergraph: `"[0:v][1:v]overlay,fps=24,format=yuv420p"`. If you do that you can also remove `-pix_fmt yuv420p`. – llogan Feb 22 '19 at 17:59
  • Hi. I'm sorry for the slow response. It seems that there was an issue with the way `subprocess.check_output` compiled the command. When I compiled the command manually, it worked a treat. – MikeCoverUps Apr 11 '19 at 08:21

1 Answers1

1

There seems to be some issue with how subprocess.check_output compiles the command. I compiled the string for the command myself and ran it with os.system and it ran without error.

MikeCoverUps
  • 723
  • 3
  • 10
  • 19