php-ffprobe
php-ffprobe copied to clipboard
json_decode() only works with UTF-8 encoded strings.
First of all, THANKS FOR YOUR COOOOOOL CODE~
There need utf8_encode() between json_decode() and shell_exec().
From
$json = json_decode(shell_exec(sprintf('ffprobe %s %s', $options, escapeshellarg($filename))));
To
$json = json_decode(utf8_encode(shell_exec(sprintf('ffprobe %s %s', $options, escapeshellarg($filename)))));