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
https://forums.phpfreaks.com/topic/173573-problem-processing-after-exec-function/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.