mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-17 06:45:06 -05:00
* support 360 and 240 as standard height as well for {vf}
This commit is contained in:
parent
8bdfaaec46
commit
c6037b03d3
@ -188,21 +188,23 @@ public class MediaBindingBean {
|
|||||||
|
|
||||||
@Define("vf")
|
@Define("vf")
|
||||||
public String getVideoFormat() {
|
public String getVideoFormat() {
|
||||||
// {def h = video.height as int; h > 720 ? 1080 : h > 480 ? 720 : 480}p
|
|
||||||
int height = Integer.parseInt(getMediaInfo(StreamKind.Video, 0, "Height"));
|
int height = Integer.parseInt(getMediaInfo(StreamKind.Video, 0, "Height"));
|
||||||
String vf = "";
|
|
||||||
|
|
||||||
if (height > 720)
|
int ns = 0;
|
||||||
vf += 1080;
|
int[] hs = new int[] { 1080, 720, 480, 360, 240, 120 };
|
||||||
else if (height > 480)
|
for (int i = 0; i < hs.length - 1; i++) {
|
||||||
vf += 720;
|
if (height > hs[i + 1]) {
|
||||||
else if (height > 360)
|
ns = hs[i];
|
||||||
vf += 480;
|
break;
|
||||||
else
|
}
|
||||||
return null; // video too small
|
}
|
||||||
|
|
||||||
// e.g. 720p
|
if (ns > 0) {
|
||||||
return vf + 'p'; // 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 null; // video too small
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user