Jump to content

Is there a way to check if a shell command is still being processed?


LanceT

Recommended Posts

I want to get a simple true/false to check if my ffmpeg is still converting a video. You can check out the shell command I executed below.

 

convertToFlv( $input, $output );

function convertToFlv( $input, $output ) {

echo "Converting $input to $output";

$command = "ffmpeg -y -i $input -acodec libfaac -ar 44100 -ab 96k -vcodec libx264 -level 41 -crf 20 -bufsize 20000k -maxrate 25000k -g 250 -r 20 -s 640x480 -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+bpyramid -me umh -subq 7 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -bf 16 -b_strategy 1 -bidir_refine 1 -refs 6 -deblockalpha 0 -deblockbeta 0 $output";

shell_exec( $command );

}

 

Can someone provide me some code that will help me check if ffmpeg is still doing the conversion?

Well, it should just keep moving through the code, so you could echo out some AJAX loader, run shell_exec, and in the line right after shell_exec do whatever.

 

And so you know, shell_exec outputs the return from the command.

  • 2 weeks later...

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.