scriptGenerator['clip05'] = function(params) {
var id = params.userName.facebookID;
//Tomo las fotos y las ajusto
var script = 'convert prod/' + id + '/input/images/wide-1.jpg -resize 640x360\\> prod/' + id + '/output/temporal/wide-1-s0.png' + endOfLine;
script += 'convert prod/' + id + '/input/images/wide-2.jpg -resize 640x360\\> prod/' + id + '/output/temporal/wide-2-s0.png' + endOfLine;
script += 'convert prod/' + id + '/input/images/wide-3.jpg -resize 640x360\\> prod/' + id + '/output/temporal/wide-3-s0.png' + endOfLine;
script += 'convert prod/' + id + '/output/temporal/wide-1-s0.png -gravity center -background black -extent 640x360 prod/' + id + '/output/temporal/wide-1-extended.png' + endOfLine;
script += 'convert prod/' + id + '/output/temporal/wide-2-s0.png -gravity center -background black -extent 640x360 prod/' + id + '/output/temporal/wide-2-extended.png' + endOfLine;
script += 'convert prod/' + id + '/output/temporal/wide-3-s0.png -gravity center -background black -extent 640x360 prod/' + id + '/output/temporal/wide-3-extended.png' + endOfLine;
//Creo Video con Zoom por foto
script += '/root/bin/ffmpeg -loop 1 -i prod/' + id + '/output/temporal/wide-1-extended.png -vf "' + "zoompan=z='zoom+0.00074':y='ih/2-(ih/zoom/2)':fps='20':d='300'" + '" -c:v libx264 -pix_fmt yuvj420p -t 1.75 -s "640x360" prod/' + id + '/output/temporal/clip05parcial-1.mp4' + endOfLine;
script += '/root/bin/ffmpeg -loop 1 -i prod/' + id + '/output/temporal/wide-2-extended.png -vf "' + "zoompan=z='zoom+0.00054':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':fps='20':d='300'" + '" -c:v libx264 -pix_fmt yuvj420p -t 1.75 -s "640x360" prod/' + id + '/output/temporal/clip05parcial-2.mp4' + endOfLine;
script += '/root/bin/ffmpeg -loop 1 -i prod/' + id + '/output/temporal/wide-3-extended.png -vf "' + "zoompan=z='zoom+0.00084':x='iw/2+(iw/zoom/2)':y='ih/2-(iw/zoom/2)':fps='20':d='300'" + '" -c:v libx264 -pix_fmt yuvj420p -t 2.42 -s "640x360" prod/' + id + '/output/temporal/clip05parcial-3.mp4' + endOfLine;
script += "bash -c '" +' /root/bin/ffmpeg -f concat -i <(echo "' + "file '$PWD/prod/" + id + "/output/temporal/clip05parcial-1.mp4'" + '"; echo "file ' + "'$PWD/prod/" + id + "/output/temporal/clip05parcial-2.mp4'" + '"; echo "file ' + "'$PWD/prod/" + id + "/output/temporal/clip05parcial-3.mp4'" + '") -c copy prod/'+ id + '/output/temporal/clip05parcial.mp4' + "'" + endOfLine;
//Hago Procesamiento y union fina con el video original
script += '/root/bin/ffmpeg -i input/videos/clip05.mp4 -i prod/' + id + '/output/temporal/clip05parcial.mp4 -filter_complex "overlay" prod/' + id + '/output/temporal/clip05final-nofade.mp4' + endOfLine;
//Aplico Fade in/out
script += '/root/bin/ffmpeg -i prod/' + id + '/output/temporal/clip05final-nofade.mp4 -y -vf "fade=in:0:15,fade=out:135:15" prod/' + id + '/output/temporal/clip05final.mp4';
return script;
};
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.