Unable to call exec in PHP to run video conversion

Source: Internet
Author: User
You cannot call exec to run video conversions in PHP.
I upload a user video to the server and then run exec to perform the ffmpeg operation, but the FFmpeg command: For example, under CMD. Running Ffmpeg-i 1.avi 2.flv is normal, but when you exec in PHP ("Ffmpeg-i. /1/1.avi. /1/1.flv "); When you do not see the converted file. Should be an execution failure. How do I call ffmpeg this external command????
------Solution--------------------
.. /1/1.avi. /1/1.flv

What is this? Path? Make sure the path is correct.
------Solution--------------------
EXEC ("Ffmpeg-i. /1/1.avi. /1/1.flv "); Instead of trying to be absolutely the path.

For example:
$source = DirName (dirname (__file__)). " /1/1.avi ";
$dest = DirName (dirname (__file__)). " /1/1.flv ";
EXEC ("Ffmpeg-i". $source. " ". $dest);
  • 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.