Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7667481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:06:51+00:00 2026-05-31T15:06:51+00:00

I’m trying to run ffmpeg through a PHP exec call, I’ve been debugging for

  • 0

I’m trying to run ffmpeg through a PHP exec call, I’ve been debugging for a while and looked at lot of responses on here, but still not found any answers…

My simplified call is:

$cmd = 'ffmpeg 2>&1';

exec(escapeshellcmd($cmd), $stdout, $stderr);

var_dump($stderr);
var_dump($stdout);
var_dump($cmd);
exit;

My output is $stderr = int(1) and $stdout = array(0) { }

Also I tried shell_exec($cmd) which returns NULL.

cmd.exe has permissions set for the IUSR account – e.g. I can run $cmd = 'dir' and see a directory listing output.

PHP is not running in safe mode.

The ffmpeg.exe is in the same directory as my php file, but I have the same response giving an absolute path to the ffmpeg.exe file in $cmd.

ffmpeg is executing fine from the command line.

I’m running Windows XP, IIS and PHP 5.3.

EDIT:

If I run ‘ffmpeg -h’ I get the help commands, which must indicated that ffmpeg is recognised

I’ve increased the PHP memory limit to 1024 – no luck.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:06:52+00:00Added an answer on May 31, 2026 at 3:06 pm

    I’ve now got this working – I think there may have been several issues:

    It turns out that $cmd = 'ffmpeg' returns null, so it’s not a good test!

    Also running escape shell command on ‘2>&1’ echoes 2^>^&1″ – I think this was my original problem.

    I’ve now managed to rea test file using: ‘ffmpeg -i SAMPLE.AVI 2>&1’.

    Working code:

    $cmd = 'ffmpeg -i SAMPLE.AVI 2>&1';
    
    exec($cmd, $output, $value);
    
    var_dump($output);
    var_dump($value);
    var_dump($cmd);
    exit;
    

    As noted above ffmpeg is a bit of a memory hog, so it’s worth checking memory too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.