Jump to content

Problem processing after exec() function


yock

Recommended Posts

I am running an exec() function which calls FFmpeg to run through converting a video, which it does successfully.

 

A problem I am running into is on certain servers a mysql_query which follows right after exec does not run. Somehow skips it.

 

Any suggestions here?

 

I have included the portion of code i'm referring to.

//Convert Video
		exec("".$ffmpeg_path." -pass 1 -passlogfile ".$logfile." -i ".$video_embed." -y -f flv -ar 44100 -ab 128 -ac 1 -acodec mp3 -deinterlace -nr 500 -me_range 20 -b 350k ".$video_full_min.".flv");
		exec("".$ffmpeg_path." -pass 2 -passlogfile ".$logfile." -i ".$video_embed." -y -f flv -ar 44100 -ab 128 -ac 1 -acodec mp3 -deinterlace -nr 500 -me_range 20 -b 350k ".$video_full_min.".flv");

		check_online($fifteen_thumb, $video_online, $video_id);

 

check_online function

//check for thumbnail 15 - if no thumb declare video in error, else declare video ok
function check_online($fifteen_thumb, $video_online, $video_id){
if(!file_exists($fifteen_thumb)) {
	$video_online = 'E';
}

if( $video_online == 'S' ){
	$video_online = 'N';
} elseif ( $video_online == 'E' ){
	$video_online = 'E';
} else {
	if($video_date <= $date_today){
		$video_online = 'Y';
	} else {
		$video_online = 'F';
	}
}

mysql_query("UPDATE bls_posts SET online = '$video_online' WHERE ID = '$video_id'");

}

 

Thanks.

Link to comment
Share on other sites

First off, change exec to shell_exec, or you might start to run into problems later.

 

Second, have you checked if the correct values are getting passed to your check_online() function?

 

Yeah I actually tried the check_online function further up in the app and it works perfectly. I will swap out exec for shell_exec, thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.