如何在Android Studio中使用FFmpegMediaMetadataRetriever?

时间:2016-03-30 10:50:04

标签: android android-studio ffmpeg mediametadataretriever

我在“Eclipse”中使用FFmpegMediaMetadataRetriever和fmmr.jar文件它工作正常但是现在我已经在“Android Studio”中迁移了我的项目。我在build.gradle文件中使用了以下依赖项。

dependencies {
compile 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.5'

}

但是我发现了以下错误

03-30 16:07:10.030: E/AndroidRuntime(7763): java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libavutil.so.54" needed by "libswscale.so"; caused by library "libavutil.so.54" not found
03-30 16:07:10.030: E/AndroidRuntime(7763): at java.lang.Runtime.loadLibrary(Runtime.java:365)
03-30 16:07:10.030: E/AndroidRuntime(7763): at java.lang.System.loadLibrary(System.java:526)
03-30 16:07:10.030: E/AndroidRuntime(7763): at wseemann.media.FFmpegMediaMetadataRetriever.<clinit>(FFmpegMediaMetadataRetriever.java:124)

请建议我如何解决此错误。

1 个答案:

答案 0 :(得分:0)

此问题已在1.0.9版中解决:

     //getting the currency values from session.
         session_start();
       //old currency
         $from=(!empty($_SESSION['old_currency']))?$_SESSION['old_currency']:'INR';
         echo 'From:&nbsp;'.$from.'<br>';
  //new currency  
  $to=(!empty($_SESSION['new_currency']))?$_SESSION['new_currency']:'INR';
         echo 'To:&nbsp;'.$to.'<br>';
    //amount to be converted.

    $prize=array('2000','600','7000','2500','100000');
 $prize_old =(!empty($_SESSION['old_prize']))?$_SESSION['old_prize']:$prize; 
$prize_new =(!empty($_SESSION['new_prize']))?$_SESSION['new_prize']:$prize;  
$prize_converted = array();
    echo '<br><br>';
    for($i=0;$i<5;$i++){
        //call the currency convert function 
        if($from!=$to)
        {
            $response=currencyConvert($from,$to, $prize_new[$i]);
            $converted_amount=filter_var($response,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
            array_push($prize_converted,round($converted_amount));
        }
        else
        {
            $converted_amount=$prize[$i];
             array_push($prize_converted,$converted_amount);

        }
        echo '<span>'.$converted_amount.' '.$to.'</span><hr/>';
    }
$_SESSION['old_priz'] = $prize;  
$_SESSION['new_prize'] = $prize_converted;


//make the api request for convert currency.
function currencyConvert($from,$to,$amount){
  // echo '<br>convert'.$f.'to'.$t;
     $url = "http://www.google.com/finance/converter?a=$amount&from=$from&to=$to"; 

    $request = curl_init(); 
    $timeOut = 0;
    curl_setopt ($request, CURLOPT_URL, $url); 
    curl_setopt ($request, CURLOPT_RETURNTRANSFER, 1); 

    curl_setopt ($request, CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)"); 
    curl_setopt ($request, CURLOPT_CONNECTTIMEOUT, $timeOut); 
    $response = curl_exec($request);
    curl_close($request);
    $regex  = '#\<span class=bld\>(.+?)\<\/span\>#s';
    preg_match($regex, $response, $converted);
    if(!empty($converted))
    return  ($converted[0])?$converted[0]:0;

}