Skip to content

Instantly share code, notes, and snippets.

@jasonbradley
Created July 7, 2012 21:51
Show Gist options
  • Save jasonbradley/3068209 to your computer and use it in GitHub Desktop.
Save jasonbradley/3068209 to your computer and use it in GitHub Desktop.
Convert video to h264
function convertVideoToH264($original_file_path, $converted_file)
{
//convert it
$cmd = "ffmpeg -i ".$original_file_path." -crf 20 -bufsize 20000k -maxrate 25000k -vcodec libx264 $converted_file";
shell_exec($cmd);
if (!is_file($converted_file))
{
echo "FFMPEG conversion failed!, Skipping...";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment