1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00

* make {vf} only evaluate to standard tags like 1080p, 720p, 480p

* the old {vf} binding is now {hpi}
This commit is contained in:
Reinhard Pointner 2012-07-08 12:38:34 +00:00
parent 9cd320431a
commit 861d557e92
2 changed files with 21 additions and 1 deletions

View File

@ -187,6 +187,26 @@ public class MediaBindingBean {
@Define("vf")
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"));
String vf = "";
if (height > 720)
vf += 1080;
else if (height > 480)
vf += 720;
else if (height > 360)
vf += 480;
else
return null; // video too small
// e.g. 720p
return vf + 'p'; // nobody actually wants files to be tagged as interlaced, e.g. 720i
}
@Define("hpi")
public String getExactVideoFormat() {
String height = getMediaInfo(StreamKind.Video, 0, "Height");
String scanType = getMediaInfo(StreamKind.Video, 0, "ScanType");

View File

@ -2,4 +2,4 @@
parameter.exclude: ^StreamKind|Count$
# preview expressions (keys are tagged so they can be sorted alphabetically)
expressions: n,y,s,e,t,airdate,startdate,absolute,special,imdb,episode,sxe,s00e00,movie,vc,ac,cf,vf,af,resolution,ws,sdhd,source,group,crc32,fn,ext,file,pi,pn,lang,actors,director,genres,certification,rating,info.runtime,info.status,media.title,media.durationString,media.overallBitRateString,video.codecID,video.frameRate,video.displayAspectRatioString,video.height,video.scanType,audio.format,audio.bitRateString,audio.language,text.codecInfo,text.language
expressions: n,y,s,e,t,airdate,startdate,absolute,special,imdb,episode,sxe,s00e00,movie,vc,ac,cf,vf,af,resolution,hpi,ws,sdhd,source,group,crc32,fn,ext,file,pi,pn,lang,actors,director,genres,certification,rating,info.runtime,info.status,media.title,media.durationString,media.overallBitRateString,video.codecID,video.frameRate,video.displayAspectRatioString,video.height,video.scanType,audio.format,audio.bitRateString,audio.language,text.codecInfo,text.language