<?php

$pics = $_GET['pics'];
$ras = $_GET['ras'];
$resultado = '';

urldecode ( $pics );
$pics = explode(',',$pics);

//CAMBIAR RUTA POR EJECUTABLE
$ruta_videos = "C://wamp64//www/VISUAL_CHECK//videos//";
$file = fopen('temp_videos.txt','w');
foreach ($pics as $valor){
	fwrite($file,'file '.$ruta_videos.'ras'.$ras.'/T'.$valor.'.mp4'.PHP_EOL);
}
fclose($file);

$resultado = exec("ffmpeg -y -f concat -safe 0 -i temp_videos.txt -c copy ".$ruta_videos."temp.mp4");
echo 'OK';




?>