Spaces:
Runtime error
Runtime error
import os | |
import sys | |
def run_ffmpeg(input_variable, output_variable): | |
# Construct the FFmpeg command using the input and output variables | |
command = f'ffmpeg -i {input_variable} -vf "scale=640:480" -b:v 1000k -vcodec libx264 -acodec aac {output_variable}' | |
# Execute the FFmpeg command using os.system() | |
os.system(command) | |
if __name__ == '__main__': | |
# Check if the script is being executed directly | |
if len(sys.argv) != 3: | |
print('Usage: python script.py input_file output_file') | |
else: | |
input_file = sys.argv[1] | |
output_file = sys.argv[2] | |
run_ffmpeg(input_file, output_file) | |