FFmpeg修剪精度低

时间:2019-02-02 15:29:52

标签: android ffmpeg video-processing android-ffmpeg

因此,我试图将1分钟29秒的视频切成30秒的片段。 预期输出为30秒,30秒,29sec。 其结果是35秒,29sec,23sec。

这是我的代码-

 ArrayList<String> commandList = new ArrayList<>();
            commandList.add("-ss");
            commandList.add("00:00:00");
            commandList.add("-i");
            commandList.add(videoPath);
            commandList.add("-c");
            commandList.add("copy");
            commandList.add("-f");
            commandList.add("segment");
            commandList.add("-segment_time");
            commandList.add("00:00:30");
            commandList.add(TEST.getAbsolutePath());
            String[] command  = commandList.toArray(new String[commandList.size()]);
            execFFmpegBinary(command);

知道我在做什么错吗?我在某处读到,如果在特定位置不存在关键帧,它将试图找到最近的关键帧。

任何解决方案或指南都会对我有所帮助。预先谢谢你。

1 个答案:

答案 0 :(得分:1)

FFmpeg将在关键帧上开始分段。使用-codec copy时没有转码,因此它必须使用现有的关键帧。 30秒没有关键帧,因此它会在下一个剪切。

相关问题