Problem scenario: use ffmpeg to transcode the file. Problem Description: using php to call the terminal ffmpeg command through exec (), passthru (), system () to implement transcoding code: {code ...} running this php file on the terminal can be transcoded normally, but it can be passed... problem scenario: use ffmpeg to transcode the file.
Problem Description: use php to call the terminal ffmpeg command through exec (), passthru (), and system () to implement transcoding.
The code is as follows:
$ Cmd = '/usr/local/bin/ffmpeg-I test. mpg-c: v libx264-B: v 1024 k-B: a 128 k-ar 16000 fina65555431l.mp4 '; echo shell_exec ('whoam'); passthru ($ cmd, $ res); var_dump ('zhuangtai '. $ res );
Running this php file on the terminal can be transcoded normally.
However, access to this file through the web cannot be transcoded. Why ??
I didn't write the full path of ffmpeg before. the passthru () status code cannot find the command. now, access in the web returns 1, indicating that the execution was not successful.
Directly execute the php file in. is the status 0? the execution is successful.
Does ffmpeg have problems with user permissions?
The user printed on the web is www-data.
The terminal is root.
I have never done it. what is the reason for this situation ....
. Urgent...
The younger brother is engaged in mobile development. he is not familiar with this. he has a lot of Google himself and has not found the reasons and solutions ----
-------!!!!!!!!!!!!!