bytedeco/javacv

FFmpegFrameGrabber can't handle APE audio format

Open

#1,300 opened on Sep 19, 2019

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
bughelp wanted

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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