diff --git a/CHANGELOG.md b/CHANGELOG.md index 65d36723..87d58c33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Override `FFmpegFrameGrabber.getVideoCodecName()/getAudioCodecName()` to return names of opened codecs ([pull #1901](https://github.com/bytedeco/javacv/pull/1901)) * Add `FrameGrabber.videoDisposition/audioDisposition` properties to select streams by disposition ([pull #1879](https://github.com/bytedeco/javacv/pull/1879)) * Work around `OpenKinect2FrameGrabber` failing when provided with a pipeline on some system ([pull #1886](https://github.com/bytedeco/javacv/pull/1886)) * Fix `FFmpegFrameRecorder.record()` incorrectly flushing the video codec on data frames ([issue #1858](https://github.com/bytedeco/javacv/issues/1858)) diff --git a/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java b/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java index bb57852e..35d0c1ac 100644 --- a/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java +++ b/src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java @@ -463,6 +463,11 @@ public boolean hasAudio() { return video_c == null ? super.getVideoCodec() : video_c.codec_id(); } + @Override + public String getVideoCodecName(){ + return video_c == null ? super.getVideoCodecName() : video_c.codec().name().getString(); + } + @Override public int getVideoBitrate() { return video_c == null ? super.getVideoBitrate() : (int)video_c.bit_rate(); } @@ -525,6 +530,10 @@ public double getVideoFrameRate() { return audio_c == null ? super.getAudioCodec() : audio_c.codec_id(); } + @Override public String getAudioCodecName() { + return audio_c == null ? super.getAudioCodecName() : audio_c.codec().name().getString(); + } + @Override public int getAudioBitrate() { return audio_c == null ? super.getAudioBitrate() : (int)audio_c.bit_rate(); }