пятница, 30 декабря 2022 г.

PS2 video convertation

The script converts videos to AVI format. The results can be play in SMS (Simple Media System) player.

import glob
import os

FFMPEG_EXEC = "C:\\Users\\user\\convertation\\ffmpeg-n4.4-latest-win64-gpl-4.4\\bin\\ffmpeg.exe"
source_files = []
output_files = []
for filename in glob.iglob(os.path.join(os.getcwd(),'MP4\*.*'), recursive=True):
    source_files.append(filename)
    output_files.append(os.path.join(os.getcwd(),"AVI",os.path.basename(filename)[:-4] + ".avi"))

for i in range(0,len(source_files)):
    cmd = f'{FFMPEG_EXEC} -i \"{source_files[i]}\" -filter:v scale=1024:-1 -q:v 5 -c:a copy \"{output_files[i]}\"'
    process = subprocess.check_output(cmd)

Комментариев нет:

Отправить комментарий