[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?

Source: Internet
Author: User
[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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.