mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-10 06:20:27 -04:00
* 1080p/720p/etc values are defined now by height as well as width
This commit is contained in:
parent
9065429152
commit
ca999c82a9
@ -257,22 +257,22 @@ public class MediaBindingBean {
|
|||||||
|
|
||||||
@Define("vf")
|
@Define("vf")
|
||||||
public String getVideoFormat() {
|
public String getVideoFormat() {
|
||||||
|
int width = Integer.parseInt(getMediaInfo(StreamKind.Video, 0, "Width"));
|
||||||
int height = Integer.parseInt(getMediaInfo(StreamKind.Video, 0, "Height"));
|
int height = Integer.parseInt(getMediaInfo(StreamKind.Video, 0, "Height"));
|
||||||
|
|
||||||
int ns = 0;
|
int ns = 0;
|
||||||
|
int[] ws = new int[] { 1920, 1280, 720, 360, 240, 120 };
|
||||||
int[] hs = new int[] { 1080, 720, 480, 360, 240, 120 };
|
int[] hs = new int[] { 1080, 720, 480, 360, 240, 120 };
|
||||||
for (int i = 0; i < hs.length - 1; i++) {
|
for (int i = 0; i < ws.length - 1; i++) {
|
||||||
if (height > hs[i + 1]) {
|
if (width > ws[i + 1] && height > hs[i + 1]) {
|
||||||
ns = hs[i];
|
ns = hs[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ns > 0) {
|
if (ns > 0) {
|
||||||
// e.g. 720p, nobody actually wants files to be tagged as interlaced, e.g. 720i
|
// e.g. 720p, nobody actually wants files to be tagged as interlaced, e.g. 720i
|
||||||
return String.format("%dp", ns);
|
return String.format("%dp", ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null; // video too small
|
return null; // video too small
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user