2
I need to rotate a command via shell which can have accent (involves filename) by PHP. Printing the command and rotating it in the hand it runs with the accent, but with the shell_exec
it does not rotate. If I remove the seat from the file name it rotates the right command with the shell_exec
, but I really can’t change the file name.
<?php
header("Content-Type: text/html; charset=ISO-8859-1",true);
$path = "C:\\Users\\gabriela.mattos\\Desktop\\audios\\";
$diretorio = dir($path);
while($arquivo = $diretorio -> read()){
if ($arquivo != "." && $arquivo != ".."){
$arquivo2= (utf8_encode($arquivo));
$arquivo2 = str_replace(" ","_",$arquivo2);
$arquivoConvertido = str_replace(".mp3",".avi",$arquivo2);
echo shell_exec(utf8_encode("ffmpeg -loop 1 -y -i C:\\Users\\gabriela.mattos\\Pictures\\logo.jpg -i ".$path.$arquivo2." -shortest -acodec copy -vcodec mjpeg ".$path.$arquivoConvertido.""));
}
}
$diretorio -> close();
?>