Changed ffmpeg step to relative paths

This commit is contained in:
Jeremy Karst 2024-05-18 19:05:21 -04:00
parent 238921eda3
commit bf7c34c834

View file

@ -10,9 +10,10 @@ import tqdm
path_to_images = r"..\composite\goes16" path_to_images = r"..\composite\goes16"
temp_path = r"..\vid" temp_path = r"..\vid"
output_file = r"..\goes16.mp4" output_file = r"..\goes16_2023.mp4"
starttime = time.mktime(datetime.datetime(2024, 1, 1).timetuple()) ffmpeg_path = r"..\ffmpeg.exe"
stoptime = time.mktime(datetime.datetime(2099, 1, 1).timetuple()) starttime = time.mktime(datetime.datetime(2023, 1, 1).timetuple())
stoptime = time.mktime(datetime.datetime(2024, 1, 1).timetuple())
min_file_size = 200000 # Detect and remove corrupted files by filtering by file size min_file_size = 200000 # Detect and remove corrupted files by filtering by file size
max_file_size = 500000 max_file_size = 500000
@ -49,7 +50,7 @@ for t, f in tqdm.tqdm(files_by_time.items(), desc="Copying files to transcode di
prevtime = t prevtime = t
index += 1 index += 1
command_line = f'ffmpeg -framerate 60 -pattern_type sequence -i "{os.path.join(temp_path, r"%06d.jpg")}" -c:v libx264 -crf 18 -preset veryfast {output_file}' command_line = f'{ffmpeg_path} -framerate 60 -pattern_type sequence -i "{os.path.join(temp_path, r"%06d.jpg")}" -c:v libx264 -crf 18 -preset veryfast {output_file}'
print(command_line) print(command_line)
pipe = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE).stdout pipe = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE).stdout