bytedeco/javacv

FFmpegFrameGrabber can't handle APE audio format

Open

#1.300 geöffnet am 19. Sept. 2019

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Java (1.583 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (6.985 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide