ffmpeg默认执行覆盖操作,-y指令

This commit is contained in:
阿甘 2024-08-29 00:53:23 +08:00
parent 1e8747f557
commit 7016a75401

View File

@ -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)
}
//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(){