android:视频水印显示错误

时间:2016-04-26 11:58:49

标签: android ffmpeg watermark

我想为视频添加水印,下面是我的代码,但是当我尝试运行时,它会显示错误,如Failed to validate license file, existing!

    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,但它没有找到任何正确的解决方案,所以请帮忙。 提前谢谢。

1 个答案:

答案 0 :(得分:0)

我通过onCreate方法中的declair path解决了Failed to validate license file, existing!的问题,如St​​ring strAudioFolderPath =" / sdcard / Download";