} /* if ($mb_concept == "2" || $mb_concept == "3") { $mb_name_age_caption = $mb_baby_name." (".$mb_baby_age.")"; $cap_image2_2 = caption_image2_white($mb_name_age_caption, $mb_serial,"2",$caption_image2_name_w,$caption_image2_name_h); } */ } $img_name5arr = explode(".", stripslashes($img_name5)); $img_name5arr_num = count($img_name5arr) - 1; if ($img_name5arr[$img_name5arr_num] == "jpeg") { $img_name5arr[$img_name5arr_num] = "jpg"; } $img_name5 = $mb_serial . "_5." . strtolower($img_name5arr[$img_name5arr_num]); $new_image5 = merge_image($img_name5, $mb_serial, "5", $mb_concept); $f_img_name5 = $mb_serial . "_5.jpg"; $new_image5_1 = merge_image2($f_img_name5, $mb_serial, "5", $mb_concept); //$cap_image5 = caption_image($mb_caption5, $mb_serial,"5"); sleep(3); $output = "ffmpeg \\"; $output .= "-loop 1 -t 2 -i ./MOBILE/scene/concept_" . $mb_concept . "_1.jpg \\"; $output .= "-loop 1 -t 1.5 -i ./files/" . $mb_serial . "/medium/final_" . $mb_serial . "_1.jpg \\"; $output .= "-loop 1 -t 1.5 -i ./files/" . $mb_serial . "/medium/final_" . $mb_serial . "_2.jpg \\"; $output .= "-loop 1 -t 2 -i ./files/" . $mb_serial . "/medium/final_" . $mb_serial . "_5.jpg \\"; $output .= "-filter_complex \\"; $output .= '"[1:v][0:v]blend=all_expr='; $output .= "'A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b1v]; \\"; $output .= " [2:v][1:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b2v]; \\"; $output .= " [3:v][2:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b3v]; \\"; $output .= ' [0:v][b1v][1:v][b2v][2:v][b3v][3:v]concat=n=7:v=1:a=0,format=yuv420p[v]" -pix_fmt yuv420p -map "[v]" ./files/' . $mb_serial . '/output.mp4';
$img_name2arr = explode(".", stripslashes($img_name2)); $img_name2arr_num = count($img_name2arr) - 1; $img_name2 = $_SESSION['ss_serial'] . "_2." . $img_name2arr[$img_name2arr_num]; $new_image2 = merge_image($img_name2, $_SESSION['ss_serial'], "2"); } if ($img_name3) { $img_name3arr = explode(".", stripslashes($img_name3)); $img_name3arr_num = count($img_name3arr) - 1; $img_name3 = $_SESSION['ss_serial'] . "_3." . $img_name3arr[$img_name3arr_num]; $new_image3 = merge_image($img_name3, $_SESSION['ss_serial'], "3"); } if ($img_name4) { $img_name4arr = explode(".", stripslashes($img_name4)); $img_name4arr_num = count($img_name4arr) - 1; $img_name4 = $_SESSION['ss_serial'] . "_4." . $img_name4arr[$img_name4arr_num]; $new_image4 = merge_image($img_name4, $_SESSION['ss_serial'], "4"); } if ($img_name5) { $img_name5arr = explode(".", stripslashes($img_name5)); $img_name5arr_num = count($img_name5arr) - 1; $img_name5 = $_SESSION['ss_serial'] . "_5." . $img_name5arr[$img_name5arr_num]; $new_image5 = merge_image($img_name5, $_SESSION['ss_serial'], "5"); } /* $out_exec = 'ffmpeg \ -loop 1 -i ./files/'.$_SESSION['ss_phone'].'/'.$img_name1.' \ -loop 1 -i ./files/'.$_SESSION['ss_phone'].'/'.$img_name2.' \ -loop 1 -i ./files/'.$_SESSION['ss_phone'].'/'.$img_name3.' \ -loop 1 -i ./files/'.$_SESSION['ss_phone'].'/'.$img_name4.' \ -loop 1 -i ./files/'.$_SESSION['ss_phone'].'/'.$img_name5.' \ -filter_complex \ "[0:v]trim=duration=15,fade=t=out:st=14.5:d=0.5[v0]; \ [1:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v1]; \ [2:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v2]; \ [3:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v3]; \ [4:v]trim=duration=15,fade=t=in:st=0:d=0.5,fade=t=out:st=14.5:d=0.5[v4]; \ [v0][v1][v2][v3][v4]concat=n=5:v=1:a=0,format=yuv420p[v]" -map "[v]" out.mp4'; exec($out_exec,$output); */ echo $new_image1; break; }
$caption_image1_h = "362;"; $caption_image2_w = "40;"; $caption_image2_h = "440;"; $caption_image2_name_w = "40;"; $caption_image2_name_h = "393;"; } } } } $img_name1arr = explode(".", stripslashes($img_name1)); $img_name1arr_num = count($img_name1arr) - 1; if ($img_name1arr[$img_name1arr_num] == "jpeg") { $img_name1arr[$img_name1arr_num] = "jpg"; } $img_name1 = $mb_serial . "_1." . strtolower($img_name1arr[$img_name1arr_num]); $new_image1 = merge_image($img_name1, $mb_serial, "1", $mb_concept); $f_img_name1 = $mb_serial . "_1.jpg"; $new_image1_1 = merge_image2($f_img_name1, $mb_serial, "1", $mb_concept); if ($mb_concept == "2") { $cap_image1 = caption_image_white($mb_caption1, $mb_serial, "1", $caption_image1_w, $caption_image1_h); $mb_name_age_caption = $mb_baby_name . " (" . $mb_baby_age . ")"; $cap_image1_2 = caption_image2_white($mb_name_age_caption, $mb_serial, "1", $caption_image1_name_w, $caption_image1_name_h); } else { if ($mb_concept == "3") { $rs_caption_w3 = txt_position($mb_caption1, $mb_concept); $cap_image1 = caption_image_yellow($mb_caption1, $mb_serial, "1", $rs_caption_w3, $caption_image1_h); } else { if ($mb_concept == "4") { $cap_image1 = caption_image_white4($mb_caption1, $mb_serial, "1", $caption_image1_w, $caption_image1_h); } else { //$mb_caption1 = "어느덧 쑥쑥 자라서 너무 고마워";