up res to 1080p

This commit is contained in:
Samuel Newman
2024-06-06 11:00:43 +03:00
parent af02488812
commit 1412d2a544
+1 -1
View File
@@ -6,7 +6,7 @@ export async function compressVideo(file: string) {
const ext = file.split('.').pop()
const newFile = file.replace(`.${ext}`, 'compressed.mp4')
const result = await FFmpegKit.execute(
`-i ${file} -c:v libx264 -crf 28 -preset ${PRESET} -b:v 1M -vf "scale=-1:720" -t 90 -c:a aac -b:a 128k -movflags +faststart ${newFile}`,
`-i ${file} -c:v libx264 -crf 28 -preset ${PRESET} -b:v 4M -vf "scale='if(gt(a,1),min(1920,iw),-1)':'if(gt(a,1),-1,min(1920,ih))'" -t 90 -c:a aac -b:a 128k -movflags +faststart ${newFile}`,
)
return {