bytedeco/javacv

FFmpegFrameGrabber can't handle APE audio format

Open

#1,300 建立於 2019年9月19日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)Java (1,583 fork)batch import
bughelp wanted

倉庫指標

Star
 (6,985 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Version

<dependency>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacv</artifactId>
    <version>1.4.4</version>
</dependency>
<dependency>
    <groupId>org.bytedeco.javacpp-presets</groupId>
    <artifactId>ffmpeg</artifactId>
    <version>4.1-1.4.4</version>
    <classifier>linux-x86_64</classifier>
</dependency>

Demo

@Test
public void testGrabApe() throws FileNotFoundException, FrameGrabber.Exception {
    // Example file is downloaded from https://example-files.online-convert.com/audio/ape/example.ape, also see attach file at the end.
    FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(new FileInputStream("/path/to/example.ape"));
    grabber.start();

    Frame frame = grabber.grabSamples();
    while (frame != null) {
        System.out.println("frame.timestamp=" + frame.timestamp / 1e6);
        frame = grabber.grabSamples();
    }
}

Output

Input #0, ape, from 'java.io.BufferedInputStream@240237d2':
  Duration: 00:00:35.91, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: ape (APE  / 0x20455041), 44100 Hz, stereo, s16p
[ape @ 0x7f4710a52f40] Got unexpected packet size after a partial decode
[ape @ 0x7f4710a52f40] Got unexpected packet size after a partial decode
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol

Expected

Handle APE audio format corectly

Any help would be appreciated.

example.ape.zip

貢獻者指南