I believe I am close to a solution :) So far I've come up with this: with open(temp_path, "w") as openfile: I have made some progress thanks to the with statement, but don't completely understand it yet as I am a beginner when it comes to python. It definitely doesn't work with NamedTemporaryFile, because it is allredy open after the function call and it causes another permission error. I am not sure how to split the arguments into a list properly, as some examples show more than one word at once etc. I Know that subprocess.Popen takes the input as a list, so I tried different variations such as: mtdt = subprocess.Popen(, stdout=subprocess.PIPE)īut the result error was basically the same. txt in the project folder, the ffmpeg command works from the cmd, which weirds me out. txt file in the directory of the script, which I hoped to be a temporary solution. Unable to find a suitable output format for '2>'Īnd it is the same if I use a. Now the output in the terminal is what I wish to parse and there is no error about the process not being able to reach the file, but there is this error message: Where temp_path is the path to the temp file, created by mkstemp. ![]() ![]() Os.system('ffmpeg -i '.format(args.input_file, temp_path), stdout=subprocess.PIPE) ![]() # why is the printed name non-existent and doesn't match tf.name in the debugger?Īp.add_argument('-i', '-input_file', help='input file')Īp.add_argument('-o', '-output_file', help='output file')Īssert args.input_file is not None, 'No input file provided.'Īssert args.output_file is not None, 'No output file provided.' Here is the problematic part isolated: import tempfile as tmpfl It uses ffmeg which is very verbose, so it was kind of hard to tell the errors apart from all its output, so I have isolated the problematic part and reconstructed the problem. I'm trying to use a program from github that applies some silly effects to videos, but it fails to read some metadata from the video and stops there.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |