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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...
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.