【问题标题】:Error while playing video in slow Motion using android-FFmpeg使用 android-FFmpeg 以慢动作播放视频时出错
【发布时间】:2021-09-06 18:06:46
【问题描述】:

它说没有找到协议

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

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

【问题讨论】:

  • 能否附上logcat信息?

标签: java android video protocol-buffers android-ffmpeg


【解决方案1】:

首先告诉我你正在使用哪个库,你是否导入了正确的模块,因为有时它缺少一些本机库,另一方面尝试像这样使用 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]","-map","[a]","-threads","4","-preset","ultrafast",fileName.getAbsolutePath()};

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

【讨论】:

  • 使用此命令时显示“找不到协议”我正在使用此库{ implementation 'com.arthenica:mobile-ffmpeg-full:4.4' }
  • 你的目标是什么android版本?,你也可以在执行命令时附加mobile-ffmpeg日志吗?也可以尝试使用这个模块(mobile-ffmpeg-full-gpl-4.4.LTS),它支持旧版本并且还包括其他一些 gpl 库
  • 我使用的是 android 11,但我也尝试过在 android 9 上发生同样的错误,而在我设置“minSdkVersion 24”和“targetSdkVersion 30”的年级时。在 logcat 结果是 { 你的意思是文件:内容://com.android.providers.media.documents/document/video%3A38845? 2021-06-24 11:38:52.603 11791-11791/com.world.technologies.labbaik.latersms E/AudioExtractorDecoder: convert Video Result is: 1 }
  • 将您的视频输出保存在 Android 文件夹内的内部包目录中,并使用此 mobile-ffmpeg-full-gpl-4.4.LTS 模块,您是否会在较旧的 android 9 中获得结果?
  • thanxsss bro .....这是存储问题,我将视频输出保存在适用于我的 Android 文件夹内的内部包目录中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-14
  • 2011-07-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多