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 6005801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:26:55+00:00 2026-05-23T01:26:55+00:00

I have a php video uploader script and at the end it initiates an

  • 0

I have a php video uploader script and at the end it initiates an ffmpeg script for the conversion of the uploaded file. It then inserts the video info into a mysql database and in the status field, a value of 0 since the file is being processed.

I was thinking that along with the linux ffmpeg command I could put a delayed process that executes a php file so that after the file is converted and the ffmpeg process is complete it executes the php file and that file has an update statement and can update the video entry in the mysql database under status to 1. To do that though I need to somehow pass the video id into the terminal so it can pass it to the php file…Anyone know how to do this?

$sql = 'INSERT INTO video (id, uploader, video_id, status) VALUES(?,?,?,?)';
$stmt3 =$conn->prepare($sql);
$result=$stmt3->execute(array($id,$username,$video_id,0));

$command = shell_exec('/usr/local/bin/ffmpeg -i /home/g/Desktop/'.$id2.' -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 /home/g/Desktop/'.$id2.'.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-23T01:26:56+00:00Added an answer on May 23, 2026 at 1:26 am

    Try this:

    $command = shell_exec('/usr/local/bin/ffmpeg -i /home/g/Desktop/'.$id2.'' .
        '-acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0' .
        '/home/g/Desktop/'.$id2.'.flv && /usr/bin/php /home/g/bin/update_db.php ' . $id2);
    

    It says to execute '/usr/bin/php /home/g/bin/update_db.php ' . $id2 if the ffmpeg(1) command succeeds. (It might fail.)

    To try this at the shell: true && echo hi and false && echo hi.

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

Sidebar

Related Questions

I have php script from where user can upload the video file. The file
I have an exec function in php file that execs a bash script. It
In my .htaccess file I have the following rule defined. RewriteRule t/([^.]+)/$ /video/tag.php?tag=$1 [QSA]
I have player.php file which calls the video player to play a certain video.
I have some task in my script that is about converting video with ffmpeg
I have written a PHP function to take a video embed code that has
In my .htaccess file I have defined following rule, RewriteRule t/([^.]+)/$ /videos/tag.php?tag=$1 [QSA] The
I have php script that creates a temporary watermark image for users that are
I have PHP scrip that goes like this: if ($cost_frm < $cost){ echo <script
Is it possible to have php not to require the begin/end tags ( <?php

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.