Skip to content

Instantly share code, notes, and snippets.

@mgng
Last active December 12, 2015 07:18
Show Gist options
  • Save mgng/4735927 to your computer and use it in GitHub Desktop.
Save mgng/4735927 to your computer and use it in GitHub Desktop.
<?php
$out = shell_exec( 'ffmpeg -i sample.mp4 2>&1' );
preg_match( '/(\d+\.\d+|\d+)\s*fps/', $out, $match );
print_r( $match );
// Array
// (
// [0] => 29.98 fps
// [1] => 29.98
// )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment