Online video converter script with ffmpeg [php]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Online video converter script with ffmpeg [php]

    please check this video converter with ffmpeg that works?
    PHP Code:
    [QUOTE]<?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;
    }[/
    QUOTE]
Working...
X