Skip to content

Commit

Permalink
* Override `FFmpegFrameGrabber.getVideoCodecName()/getAudioCodecName…
Browse files Browse the repository at this point in the history
…()` to return names of opened codecs (pull #1901)
  • Loading branch information
Tengyyy authored Oct 8, 2022
1 parent 7327f96 commit 7175b79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/bytedeco/javacv/FFmpegFrameGrabber.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 7175b79

Please sign in to comment.