Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Python subprocess will not run command

$
0
0

For some reason I have a subprocess command line that is not running the subprocess command line underneath it and doing the processing it should be.

 import subprocess import os os.chdir('/home/linux/Trial/') a = open('Attempts.txt', 'r') b = a.readlines() a.close() for c in range(0, len(b)-1):     words = list(b[c].split(" "))     d = len(words)     e = words[d-1]     f = b[c].replace(e, 'Hiccup'+ str(c) +'.mp4')     words[d-1] = 'Hiccup'+ str(c) +'.mp4'     print(f)     command = 'ffmpeg', '-i', words[2], '-ss', words[4], '-to', words[6], '-c:v copy -a copy', words[11]     print(command)     subprocess.run(['ffmpeg', '-i', words[2], '-ss', words[4], '-to', words[6], '-c:v copy -a copy', words[11]])   

When I run the following code I get the following output:

 ffmpeg -i test.mp4 -ss 00:00:00 -to 00:02:34 -c:v copy -a copy Hiccup0.mp4 ('ffmpeg', '-i', 'test.mp4', '-ss', '00:00:00', '-to', '00:02:34', '-c:v copy -a copy', 'Hiccup0.mp4')

I get nothing else. When I check no new file has been created called Hiccup0. I have ffmpeg-python installed and updated(made sure of that this morning).

What gives. I see this should work but it doesn't.


Viewing all articles
Browse latest Browse all 23131

Trending Articles