bytedeco/javacv

Problem of FFmpegFrameRecorder when using javaCV to call ffmpeg for audio codec and output audio

Open

#1,617 opened on Apr 2, 2021

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

Repository metrics

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

Description

Hello, I have a problem when using javaCV to call ffmpeg for audio transcoding. I don't know if it is a bug.

I built a FFmpegFrameGrabber and set the output parameters for it.

  • When I use stream output Using the following constructor
public FFmpegFrameRecorder(OutputStream outputStream, int audioChannels) {
        this(outputStream.toString(), audioChannels);
        this.outputStream = outputStream;
        this.closeOutputStream = true;
    }

, the final audio file will lack a ‘xing’ header data.

  • When I use filename to specify his output audio path, Call the following constructor
public FFmpegFrameRecorder(String filename, int audioChannels) {
        this(filename, 0, 0, audioChannels);
    }

the generated audio file has no problem, including the "xing" header information. The two files differ by 180 bytes.

Hope to get answers and help from everyone, thanks!

Contributor guide