Skip to main content

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.

I have a video upload script in php where i exec the following command

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

and the result flv is correct But when i exec 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 english

EDIT: if i convert from mp4 to mkv, the mkv is fine. if i get that mkv and reconvert to mp4, te final mp4 is 0 bytes

for 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);

in 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

I have a video upload script in php where I exec the following command:

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

And the result flv is correct.

But when I 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?

EDIT:

If I convert from mp4 to mkv, the mkv is fine. If I get that mkv and reconvert to mp4, the final mp4 is 0 bytes.

For 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);

In 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.

added 368 characters in body
Source Link

I have a video upload script in php where i exec the following command

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

and the result flv is correct But when i exec 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 english

EDIT: if i convert from mp4 to mkv, the outputmkv is fine. if i get that mkv and reconvert to mp4, te final mp4 is 0 bytes

for 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);

in this case, first mp4 has 1210409 bytes, the second commandresultant mkv has 816018 bytes, and the final mp4 has 0 bytes. enter image description here The same thing with mp4 -> flv -> mp4

I have a video upload script in php where i exec the following command

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

and the result flv is correct But when i exec 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 english

EDIT: the output for the second command. enter image description here

I have a video upload script in php where i exec the following command

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

and the result flv is correct But when i exec 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 english

EDIT: if i convert from mp4 to mkv, the mkv is fine. if i get that mkv and reconvert to mp4, te final mp4 is 0 bytes

for 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);

in 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

add output image
Source Link

I have a video upload script in php where i exec the following command

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

and the result flv is correct But when i exec 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 english

EDIT: the output for the second command. enter image description here

I have a video upload script in php where i exec the following command

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

and the result flv is correct But when i exec 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 english

I have a video upload script in php where i exec the following command

exec("/usr/bin/ffmpeg -i ".$folder."/".$filenameIn.".mp4 ".$folder."/".$filenameOut.".flv 2>&1", $output);

and the result flv is correct But when i exec 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 english

EDIT: the output for the second command. enter image description here

Source Link
Loading