How to check if ffmpeg is done encoding a video with PHP? -
i need specific code check php if done encoding video ffmpeg. need simple true/false check. true if encoding done, , false if not done. language php, , have ffmpeg-php installed.
more info: on linux.
code below
converttoflv( $input, $output ); function converttoflv( $input, $output ) { echo "converting $input $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 ); }
you add line of code after ffmpeg in php exec() run php page in command line.
just end ffmpeg line ";" , type "php" followed absolute location of php script run. add variable id of video waiting converted:
$cmd = "ffmpeg -i[source file] [output file]; php /public_html/etc/ffmpegcomplete.php?videoid=101"; exec( $cmd );
Comments
Post a Comment