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

  • Home
  • SEARCH
  • 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 6000575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:42:47+00:00 2026-05-23T00:42:47+00:00

I have a problem that is driving me crazy. I have a php script

  • 0

I have a problem that is driving me crazy. I have a php script that uploads a file into a directory. I could then convert it with ffmpeg but I don’t want the user to have to wait on that page, I want them to be able to change page while the ffmpeg is running on the file. How can I achieve this, do I use batch or cron or what? How will I be able to communicate with my web application once the file is processed, do I run a php file in cmd to add mysql entry?

This is my ffmpeg, if someone could give me some clarity on this I would really appreciate it. I would be willing to donate like half my points at this point.

$command =
shell_exec(‘/usr/local/bin/ffmpeg -i
/home/geoff/Desktop/cave.wmv -acodec
libfaac -aq 100 -vcodec libx264
-preset slow -crf 22 -threads 0 /home/geoff/Desktop/newvideo.flv’);

  • 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-23T00:42:48+00:00Added an answer on May 23, 2026 at 12:42 am

    I would go for crons or just create an another php script which will do converting. After user will submit the form, process the form and send the data with $_POST to video converter script and execute it without waiting for response.

    Here is an example from my framework, you can modify to your needs.

    # Executing The Script
    $data = array();
    $data['start'] = 0;
    $data['end'] = 20;
    
    $url = SITE_ROOT.CRONS_DIR.$found->path."/".$found->name.".php";
    
    $response = curlPost($url,$data,3,TRUE);
    
    if ($response){
    echo "<pre>";
    echo htmlentities($response);
    }
    
    # curlPost function
    
    function curlPost($url, $postArray = NULL, $timeout=2, $errorReport=FALSE) {
        # PREPARE THE POST STRING
        if ($postArray != NULL) {
            $postString = '';
            foreach ($postArray as $key => $val) {
                $postString .= urlencode($key) . '=' . urlencode($val) . '&';
            }
            $postString = rtrim($postString, '&');
        }
    
        # PREPARE THE CURL CALL
        $curl = curl_init();
        curl_setopt( $curl, CURLOPT_URL,            $url         );
        curl_setopt( $curl, CURLOPT_HEADER,         FALSE        );
        curl_setopt( $curl, CURLOPT_POST,           TRUE         );
        ($postArray != NULL) ? curl_setopt( $curl, CURLOPT_POSTFIELDS,     $postString ) : '';
        curl_setopt( $curl, CURLOPT_TIMEOUT,        $timeout     );
        curl_setopt( $curl, CURLOPT_RETURNTRANSFER, TRUE         );
    
        # EXECUTE THE CURL CALL
        $htm = curl_exec($curl);
        $err = curl_errno($curl);
        $inf = curl_getinfo($curl);
    
        # ON FAILURE
        if (!$htm) {
            # PROCESS ERRORS HERE
            if ($errorReport) {
                echo "CURL FAIL: {$url} TIMEOUT={$timeout}, CURL_ERRNO={$err}";
                echo "<pre>\n";
                var_dump($inf);
                echo "</pre>\n";
                createLog("CURL FAIL: {$url} TIMEOUT={$timeout}, CURL_ERRNO={$err}");
            }
            curl_close($curl);
            return FALSE;
        }
    
        # ON SUCCESS
        curl_close($curl);
        return $htm;
     }
    

    EDIT:
    You can read cURL manual. This is nothing to do with $_FILE.

    Let me explain you in different way;

    • You have form.php; this is the
      page where users see the form and
      submit the form.
    • You have upload.php or
      form_process.php; this page is going
      to record any data needed from user
      submitted form to your database.

    In the page where you are processing user submitted data, just record it to database, upload the file, after uploading the file, prepare $_POST array or any array with information which you need to convert the file.

    For example;

    $data['id'] = 100; //ID in the database
    $url = "video_converter.php";
    $response = curlPost($url, $data, 3, TRUE);
    

    In video_converter.php -> Just get the ID with $_GET, right after find the record in database, and convert the file, update the record.

    Of course, as I said you need to modify curlPost function I wrote above to your own needs. And if you have questions about what is cURL, I strongly recomend you to read the cURL manual first. If you still have questions you can ask another question always right?

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

Sidebar

Related Questions

I'm having a problem lately that's driving me crazy. I have a multi-dimensional array
Hey! Have a problem that is driving me crazy! My Main Window will not
I'm running into a little problem that's driving me crazy, and I'd welcome any
I have a problem with an ASP.NET application that is driving me nuts. When
I have a question that is driving me crazy. It is all about updating,
This problem is driving me crazy. I have the following code: 'unprotect sheet If.Range(Start).Row+1<.Range(End).Row
I have a simple yet hard problem here that is driving me nuts ...
This is driving me crazy. Very grateful if someone could help me out! Problem:
In a couple of scripts that I use I have problem that is intermittent.
I have a problem that confuses my users, being that although an item is

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.