Skip to content

Commit 7175b79

Browse files
authored
* Override FFmpegFrameGrabber.getVideoCodecName()/getAudioCodecName() to return names of opened codecs (pull #1901)
1 parent 7327f96 commit 7175b79

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
* Override `FFmpegFrameGrabber.getVideoCodecName()/getAudioCodecName()` to return names of opened codecs ([pull #1901](https://github.com/bytedeco/javacv/pull/1901))
23
* Add `FrameGrabber.videoDisposition/audioDisposition` properties to select streams by disposition ([pull #1879](https://github.com/bytedeco/javacv/pull/1879))
34
* Work around `OpenKinect2FrameGrabber` failing when provided with a pipeline on some system ([pull #1886](https://github.com/bytedeco/javacv/pull/1886))
45
* Fix `FFmpegFrameRecorder.record()` incorrectly flushing the video codec on data frames ([issue #1858](https://github.com/bytedeco/javacv/issues/1858))

src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,11 @@ public boolean hasAudio() {
463463
return video_c == null ? super.getVideoCodec() : video_c.codec_id();
464464
}
465465

466+
@Override
467+
public String getVideoCodecName(){
468+
return video_c == null ? super.getVideoCodecName() : video_c.codec().name().getString();
469+
}
470+
466471
@Override public int getVideoBitrate() {
467472
return video_c == null ? super.getVideoBitrate() : (int)video_c.bit_rate();
468473
}
@@ -525,6 +530,10 @@ public double getVideoFrameRate() {
525530
return audio_c == null ? super.getAudioCodec() : audio_c.codec_id();
526531
}
527532

533+
@Override public String getAudioCodecName() {
534+
return audio_c == null ? super.getAudioCodecName() : audio_c.codec().name().getString();
535+
}
536+
528537
@Override public int getAudioBitrate() {
529538
return audio_c == null ? super.getAudioBitrate() : (int)audio_c.bit_rate();
530539
}

0 commit comments

Comments
 (0)