spiritnax.blogg.se

Python ffmpeg output
Python ffmpeg output













python ffmpeg output

For portable code, you need to either specify shell=True, or refactor the code to avoid it (which is generally recommended wherever feasible). On Windows, for hysterical reasons, you can pass in a single string without shell=True and it will work. P = n(shlex.split("ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -i :0.0+0,0 -f alsa -ac 2 -i pulse -acodec aac -strict experimental -t 00:00:05 out.mp4"), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) Os.chdir('/home/user/Desktop/myProject/') Use the builtin command line option -t for that. to permit spaces in file names).Īnd you do not want to manually convert the string into a list of arguments !Īnd there is no need to stop ffmpeg from the outside (another reason why your file might not get written). The module to take care of any required escaping and quoting ofĪrguments (e.g. Providing a sequence of arguments is generally preferred, as it allows shlex.split is the preferred way, as you can read here:

python ffmpeg output

You should assign that to a variable, and then print out all output and errors of the command (Because i think, ffmpeg gives an error and doesn't try to write the file at all, but you do not see that).Īdditionally, you have to either set the keyword argument shell to True, or use shlex.split, else the command will not be formatted right.















Python ffmpeg output