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');