I have a video upload script in php where iI exec the following command:
exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);
andAnd the result flv is correct But.
But when i execI execute the same command with mp4 output
exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".mp4 2>&1", $output);
the output has 0 bytes.
I also tried
exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 -vcodec libx264 -crf 20 ".$folder."/".$filenameOut.".mp4");
but the output video still have 0 bytes.
I don't know why. Any help?
sorry for my englishEDIT:
EDIT: if iIf I convert from mp4 to mkv, the mkv is fine. if iIf I get that mkv and reconvert to mp4, tethe final mp4 is 0 bytes.
forFor example:
exec("/usr/bin/ffmpeg -i ".$folder."/".$filename." ".$folder."/".$filenameOut.".mkv 2>&1", $output);
exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameOut.".mkv ".$folder."/".$filename.".mp4 2>&1", $output);
inIn this case, first mp4 has 1210409 bytes, the resultant mkv has 816018 bytes, and the final mp4 has 0 bytes. The same thing with mp4 -> flv -> mp4.
