From 7016a7540124ebf4ab930dfe5d1cbd16e3a47a4f Mon Sep 17 00:00:00 2001 From: Crimson Date: Thu, 29 Aug 2024 00:53:23 +0800 Subject: [PATCH] =?UTF-8?q?ffmpeg=E9=BB=98=E8=AE=A4=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E6=93=8D=E4=BD=9C=EF=BC=8C-y=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.aardio | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.aardio b/main.aardio index dfd8f08..61e4457 100644 --- a/main.aardio +++ b/main.aardio @@ -87,13 +87,12 @@ mainForm.plus.oncommand = function(id,event){ videoPath = path; var tpath = io.splitpath(path); var vpath = io._exedir+"temp\"+tpath.name+"\"; - if(io.exist(vpath)){ - fsys.delete(vpath); + if(!io.exist(vpath)){ + io.createDir(vpath) } - io.createDir(vpath) //var ffmpeg = process.ffmpeg(,"-i "+path+" -vf fps=1 "+vpath+"\%04d.png"); - var ffmpeg = process.ffmpeg(, `-i `++path++` -vf "select=eq(n\,0)" -vframes 1 `++vpath++`\0001.png`); + var ffmpeg = process.ffmpeg(, `-i `++path++` -vf "select=eq(n\,0)" -vframes 1 -y `++vpath++`\0001.png`); ffmpeg.logResponse(mainForm.edit); ffmpeg.onResponseEnd = function(){ @@ -154,14 +153,15 @@ mainForm.plus3.oncommand = function(id,event){ var 二维码裁剪后宽度 = frmChild.width / scaleRatio; var 二维码裁剪后高度 = frmChild.height / scaleRatio; - var qrcodePath_new = qrpath.dir ++ qrpath.name ++ "-output" ++ qrpath.ext; + var qrcodePath_new = io._exedir++"temp\"++ qrpath.name ++ "-output" ++ qrpath.ext; // ffmpeg -i input.jpg -vf "scale=width:height" output.jpg - var ffmpeg = process.ffmpeg(, `-i `++ qrcodePath ++` -vf "scale=`++ 二维码裁剪后宽度 ++`:`++ 二维码裁剪后高度 ++`" `++qrcodePath_new); + var ffmpeg = process.ffmpeg(, `-i `++ qrcodePath ++` -vf "scale=`++ 二维码裁剪后宽度 ++`:`++ 二维码裁剪后高度 ++`" -y `++qrcodePath_new); + ffmpeg.logResponse(mainForm.edit); ffmpeg.onResponseEnd = function(){ // ffmpeg -i input.mp4 -i overlay.png -filter_complex "overlay=10:10" output.mp4 - var str = `-i `++ videoPath ++` -i `++ qrcodePath_new ++` -filter_complex "overlay=`++ x ++`:`++ y ++ `" ` ++ vpath.dir ++ vpath.name ++`-output`++vpath.ext; + var str = `-i `++ videoPath ++` -i `++ qrcodePath_new ++` -filter_complex "overlay=`++ x ++`:`++ y ++ `" -y ` ++ vpath.dir ++ vpath.name ++`-output`++vpath.ext; var ffmpeg = process.ffmpeg(, str); ffmpeg.logResponse(mainForm.edit); ffmpeg.onResponseEnd = function(){