[Urgent] I cannot use php to call ffmpeg in ubuntu to convert the video format, extract frames, and input the camera in real time. Is it a php setting problem? Or code problems? I follow /~ Modified the description in lyj/Programming/configure_php.html.
This is the php code for video conversion. test. avi is placed in the main folder directory and can be converted normally by using the terminal to directly input ffmpeg-I test. outavi test. asf.
$ Cmd = "ffmpeg-I test. avi outtest. asf ";
Exec ($ cmd, $ out, $ status );
Print_r ($ out );
Print_r ($ status); // 0 indicates success. 1 indicates failure.
?>
During the test in Firefox, 1 indicates a failure. please help me! What is the problem? Please !!!
Is there a problem with the php settings? How can we implement these functions through settings?
Reply to discussion (solution)
I follow
Http://blog.sina.com.cn/s/blog_568f35c701016tzb.html
Install the LAMP, and then follow
Http://dsec.pku.edu.cn /~ Lyj/Programming/configure_php.html
I modified it.
This is the php code for video conversion. test. avi is placed in the main folder directory and can be converted normally by using the terminal to directly input ffmpeg-I test. outavi test. asf.
$ Cmd = "ffmpeg-I test. avi outtest. asf ";
Exec ($ cmd, $ out, $ status );
Print_r ($ out );
Print_r ($ status); // 0 indicates success. 1 indicates failure.
?>
During the test in Firefox, 1 indicates a failure. please help me! What is the problem? Please !!!
Is there a problem with the php settings? How can we implement these functions through settings?
Dear God, I have solved the above problem, but there is a new problem. I changed the code.
// $ Str = 'ffmpeg-I/tmp/test1.avi/tmp/out. ogv ';
// $ Str = 'ffmpeg-I/tmp/test1.avi-y-f image2-t 0.001-s 352x240/tmp/jt.jpg ';
// $ Str = 'ffmpeg-I/tmp/test1.avi-r 1-s 320x240-f image2/tmp/foo-1_03d.jpeg ';
// $ Str = 'ffmpeg-f image2-I/tmp/foo-1_03d.jpeg-r 12-s 320x240/tmp/foo. avi ';
$ Str = 'ffmpeg-f video4linux2-t 20-s 320*240-r 10-I/dev/video0/tmp/te. ogv ';
$ Result = system ($ str );
?>
All comments are implemented, but $ str = 'ffmpeg-f video4linux2-t 20-s 320*240-r 10-I/dev/video0/tmp/te. ogv' is that the video input function of the camera cannot be implemented, and the code can be directly implemented in the terminal. ask how to solve this problem !!!
Hello, you have solved the problem.