1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-22 15:58:52 -05:00

Add BitRate to MediaCharacteristics

This commit is contained in:
Reinhard Pointner 2019-03-15 13:31:33 +07:00
parent 3007df1a8f
commit 53f23c8acf
3 changed files with 11 additions and 0 deletions

View File

@ -92,6 +92,11 @@ public class FFProbe implements MediaCharacteristics {
return getInteger("video", "height");
}
@Override
public Double getBitRate() {
return Double.parseDouble(getFormat().get("bit_rate").toString());
}
@Override
public Float getFrameRate() {
return find("video", "avg_frame_rate").map(fps -> {

View File

@ -19,6 +19,8 @@ public interface MediaCharacteristics extends AutoCloseable {
Integer getHeight();
Double getBitRate();
Float getFrameRate();
String getTitle();

View File

@ -178,6 +178,10 @@ public class MediaInfo implements MediaCharacteristics {
return Integer.parseInt(get(StreamKind.Video, 0, "Height"));
}
public Double getBitRate() {
return Double.parseDouble(get(StreamKind.General, 0, "OverallBitRate"));
}
@Override
public Float getFrameRate() {
return Float.parseFloat(get(StreamKind.Video, 0, "FrameRate"));