bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.42k stars 1.57k forks source link

Flac getAudioBitrate has always been 0 #2053

Open Janix520 opened 1 year ago

Janix520 commented 1 year ago

I tried it out and it seems like Flac is like this. Other formats have returns, but Flac has always been 0

Janix520 commented 1 year ago

grabber.getFormatContext().bit_rate(), Using this method returns non zero, This should be a minor issue

saudet commented 1 year ago

Interesting, could you open a pull request with a fix?

Janix520 commented 1 year ago

Sorry, I can only modify Java code, although it can be changed to if(audio c.bitRate()==0){oc.bitRate()}, but this doesn't feel like the best solution. The problem may be with native, FFmpegFrameGrabber line 1022 audio C=avcodec Alloc Context3 (codec). Thank you for this open source library. If I can fix it later, I will support it

saudet commented 1 year ago

FFmpegFrameGrabber.getAudioBitrate() is a Java method: https://github.com/bytedeco/javacv/blob/1.5.9/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java#L537