使用 android-FFmpeg 以慢动作播放视频时出错

问题描述

它说找不到协议

String[] complexCommand = {"-y","-i",selectedImageUri.toString(),"-filter_complex","[0:v]setpts=2.0*PTS[v];[0:a]atempo=0.5[a]","-map","v]","[a]","-b:v","2097k","-r","60","-vcodec","mpeg4",fileName.getAbsolutePath()};

        int rc = FFmpeg.execute(complexCommand);
        Log.e(TAG,"convert Video Result is: "+rc );

解决方法

首先告诉我你使用的是哪个库,你是否导入了正确的模块,因为有时它缺少一些本机库,另一方面尝试使用像这样的 Filter Complex,请使用以下命令并让我知道结果

String[] complexCommand = {"-y","-i",selectedImageUri.toString(),"-filter_complex","[0:v]setpts=2.0*PTS[v];[0:a]atempo=0.5[a]","-map","[v]","[a]","-threads","4","-preset","ultrafast",fileName.getAbsolutePath()};

不要忘记将您的视频输出保存在内部包目录中 Android文件夹内