2016-04-26 72 views
0

我想水印視頻,下面是我的代碼,但是當我嘗試運行時,它顯示錯誤,如Failed to validate license file, existing!android:視頻水印顯示錯誤

public class MainActivity extends AppCompatActivity { 
    private String strAudioFolderPath; 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 

     // here my ffmpeg command to watermark video. 
     String s = "ffmpeg -i /sdcard/Download/testing.mp4 -i /sdcard/temp1.jpg -filter_complex 'overlay=10:main_h-overlay_h-10' /sdcard/Download/out.mp4"; 

     GeneralUtils.deleteFileUtil(strAudioFolderPath + "vk.log"); 
     PowerManager powerManager = (PowerManager) this.getSystemService(Activity.POWER_SERVICE); 
     PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VK_LOCK"); 
     wakeLock.acquire(); 
     LoadJNI vk = new LoadJNI(); 
     try { 
      try { 
       vk.run(GeneralUtils.utilConvertToComplex(s), strAudioFolderPath, MainActivity.this); 
       Log.e("Checking water marker", ">>>>>>>>>>>>>>>"); 

      } catch (Throwable e) { 
      } finally { 
       if (wakeLock.isHeld()) 
        wakeLock.release(); 
       else { 
       } 
      } 
     } catch (Exception e) 
     { 
      e.printStackTrace(); 
     }   
    } 
} 

和錯誤在下面的logcat中顯示。

04-26 17:13:18.211 20492-20492/com.example.android.watermarkvideo I/Videokit: license file not found... 
04-26 17:13:18.211 20492-20492/com.example.android.watermarkvideo I/Videokit: license file /sdcard/Download/testing.mp4/ffmpeglicense.lic not created. 
04-26 17:13:18.211 20492-20492/com.example.android.watermarkvideo D/Videokit: license check rc: -3 
04-26 17:13:18.211 20492-20492/com.example.android.watermarkvideo E/Videokit: Failed to validate license file, existing! 

其實我用的ffmpeg庫watermak視頻文件,但它不是沃金以及我還沒有找到任何妥善的解決辦法,請幫助。 在此先感謝。

回答

0

我已經通過在像String這樣的onCreate方法中聲明路徑來解決Failed to validate license file, existing!的問題strAudioFolderPath =「/ sdcard/Download」;