I found this on a forum, well some of you might have seen this. No one shared this so I am doing it now.

PHP Code: 
<?php

function ffmpeg_convert($input_file$to_format$output_dir=null)

{
    
$input_file realpath($input_file);
    
$output_dir is_dir($output_dir) ? $output_dir dirname($input_file);

    
$output_file $output_dir.'/'.pathinfo($input_file
PATHINFO_FILENAME).'.'.$to_format;
    
    
$cmd sprintf('ffmpeg -y -i %s -f %s %s %s > /dev/null 2>&1',
        
escapeshellcmd($input_file),
        
$to_format,

        ((
$to_format=='avi'||1)?'-f avi -vcodec mpeg4 -b 175k -g 300 -bf 2 -acodec libmp3lame -ab 32k':''),
        
escapeshellcmd($output_file)
    );
echo 
$cmd;
    
exec($cmd$output$status);
    
    
$success = empty($status);
    
return 
$success $output_file false;
}
?>
Put ffmpeg also in the same folder as the script
fdls Reviewed by fdls on . Online Video Converter With ffmpeg (php) I found this on a forum, well some of you might have seen this. No one shared this so I am doing it now. <?php function ffmpeg_convert($input_file, $to_format, $output_dir=null) { $input_file = realpath($input_file); $output_dir = is_dir($output_dir) ? $output_dir : dirname($input_file); Rating: 5