Created
April 8, 2022 08:27
-
-
Save KristianLentino99/30fb281f0225a7e401f79f3e9ec7491a to your computer and use it in GitHub Desktop.
commando to compress a video with ffmpeg library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from os import path, system | |
pathFile = args[1] | |
outputFile = args[2] | |
print("Converto file "+pathFile) | |
ffmpegCommand = f'ffmpeg -y -threads 0 -i {pathFile} -c:v libx264 -x264opts \'keyint=24:min-keyint=24:no-scenecut\' -profile:v high -level 4.0 -vf "scale=min\'(720,iw)\':-4" -crf 22 -movflags faststart -write_tmcd 0 {outputFile}' | |
#folderModifiche = folderModifiche + nomeProgetto | |
command = ffmpegCommand | |
print(command) | |
os.system(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment