小编jsh*_*ssy的帖子

使用 mp4parser 剪辑 mp4。无法通过时间使用 SyncSample 进行更正

我正在编写一个 Android 应用程序,我有一堆 5-15 秒的 .mp4 文件要剪辑。我一直在尝试使用 Sebastian Annies 的 mp4parser来执行此操作,遵循此处给出的示例代码:ShortenExample

这是我正在使用的代码(与上面的示例代码非常相似):

    public static void clip(Sprinkle sprinkle, double start, double end) throws IOException {
    Movie movie = MovieCreator.build(sprinkle.getLocalVideoPath());

    // Save all tracks then remove them from movie
    List<Track> tracks = movie.getTracks();
    movie.setTracks(new LinkedList<Track>());

    boolean timeCorrected = false;

    // Here we try to find a track that has sync samples. Since we can only start decoding
    // at such a sample we SHOULD make sure that the start …
Run Code Online (Sandbox Code Playgroud)

java mp4 android clipping mp4parser

5
推荐指数
1
解决办法
2559
查看次数

标签 统计

android ×1

clipping ×1

java ×1

mp4 ×1

mp4parser ×1