Using ffmpeg encoder in elgg

I'm triying to use ffmpeg to encode videos when they are uploaded to elgg. I managed to install ffmpeg and php_ffmpeg under xampp (I'm using windows 7), I create a test.php file to test the conversion outside the elgg app and It works fine, but when I call ffmpeg inside elgg nothing happens. This is the command that I use:

$command = "$ffmpegpath -i $input $output";

@exec( $command, $ret );

Any ideas?

Thanks!