Another question if I may please.
The above ffmpeg command was successful in converting 00003.mts into filename3.mp4. I am now trying to work thsi into my python script.
Here's my script so far
Hoping someone can help.
cheers Peter
The above ffmpeg command was successful in converting 00003.mts into filename3.mp4. I am now trying to work thsi into my python script.
Here's my script so far
import subprocess import os, sys path = "C:\\upload" path2= "C:\\upload\completed" dirs = os.listdir( path ) Count=0 d = [] for file in dirs: file_path = os.path.join(path, file) file_path2 = os.path.join(path2, file) print (file_path) os.system('ffmpeg -i file_path -r 30 -s 1280x720 -c:v libx264 -crf 23 -ac 1 file_path2') Count = Count+1and here's the output
Output:>>>
= RESTART: C:/Users/Peter/AppData/Local/Programs/Python/Python36-32/test2.py =
C:\upload\00030.MTS
C:\upload\00031.MTS
C:\upload\00032.MTS
C:\upload\00033.MTS
C:\upload\completed
>>>
The object of my script is to cycle through all the files in C:\upload, process each one and put the output in c:\upload\completed. As you can see I am running into a couple of problems. First my os.system() commands don't seem to be resulting in any processing. Nothing is appearing in the completed folder. Next my loop is capturing the text 'completed as as file which is not what I want. As you can see I have 4 files in the C:\upload directory. I just want to process these and finish. I would be grateful if you could point out what I am doing wrong. I did try to use the subprocess.run command but this did not work either.Hoping someone can help.
cheers Peter