File size: 632 Bytes
0424b36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)