Bash process substitution in Python with Popen -



Bash process substitution in Python with Popen -

i'm attempting create looped video file calling ffmpeg python subprocess library. here's part that's giving me problems:

import subprocess sp sp.popen(['ffmpeg', '-f', 'concat', '-i', "<(for f in ~/desktop/*.mp4; echo \"file \'$f\'\"; done)", "-c", "copy", "~/desktop/sample3.mp4"])

with above code i'm getting next error:

<(for f in /home/delta/desktop/*.mp4; echo "file '$f'"; done): no such file or directory

i did find phrased question here. i'm not sure how solution might apply solving issue.

edit: help everyone! next advice in comments , looking elsewhere ended changing code this:

sp.popen("ffmpeg -f concat -i <(for f in ~/desktop/*.mp4; echo \"file \'$f\'\"; done) -c re-create ~/desktop/sample3.mp4", shell=true, executable="/bin/bash")

--which works fine.

following advice in comments , looking elsewhere ended changing code this:

sp.popen("ffmpeg -f concat -i <(for f in ~/desktop/*.mp4; echo \"file \'$f\'\"; done) -c re-create ~/desktop/sample3.mp4", shell=true, executable="/bin/bash")

--which works fine. – moorej

python bash ffmpeg

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -