Page 1 of 1

Strange values for video format (vf)

Posted: 08 Mar 2012, 16:36
by primo
Hi, I started using FileBot yesterday. It is a very interesting application. Good job.
I have the following doubt: is there any way to force FileBot to use ' standard' video format {vf} values like 480p, 720p, and 1080p, instead of 368p, 544p, etc.? I really don't care about the exact value. I understand this is read from the file through mediainfo, right? Is there anyway to force it to choose from these 3 specific values?

Thanks

Re: Strange values for video format (vf)

Posted: 09 Mar 2012, 00:58
by rednoah
Before HD there wasn't really a standard for video resolution for rips...

Code: Select all

{sdhd == 'HD' ? vf : '480p'}
This'll continue to use the real video data {vf} for HD content, but just say "480p" for any non-HD content.

Re: Strange values for video format (vf)

Posted: 29 Apr 2012, 08:17
by Eterimos
Hi,

thanks for this great tool first of all.

I agree with the OP that having 480p/720p/1080p would be more useful than the actual video resolution.
So this might be something like a vf category.

I don't see how I can achieve this with the format rules. Am I missing something?
It should be if (vf > 1000) use 1080p else if (vf > 700) use 720p else use 480p. (for example)
If it's possible please let us know.

Thanks

Re: Strange values for video format (vf)

Posted: 29 Apr 2012, 08:57
by rednoah
Sure, why wouldn't it?

Here you go:

Code: Select all

{def h = video.height as int; h > 1000 ? 1080 : h > 700 ? 720 : 480}p

Re: Strange values for video format (vf)

Posted: 29 Apr 2012, 13:09
by Eterimos
Excellent! Just what I wanted.
Thank you very much!

Re: Strange values for video format (vf)

Posted: 01 May 2012, 01:19
by plastiqueusa
I just discovered Filebot today have got a slightly modified version of sortiva.groovy up and running, applying my preferred naming format. However, there are a couple of custom values I'd like to incorporate:

1. For video format calculation, reference the default value and round up to the nearest breakpoint (360p, 480p, 720p, 1080p).
2. For sd/hd calculation, reference the video format value and set as HD if higher than 480p; otherwise, SD.

I took a look at the snippets posted here and spent some time tweaking them and trying to incorporate them into the sortiva script, but in each case the script stopped working altogether. I can't quite figure out what's going wrong, so any help is appreciated.

Thanks

Re: Strange values for video format (vf)

Posted: 01 May 2012, 01:31
by rednoah
Make sure you don't break mess up the Groovy syntax. If it's format:'...' you can't use ' in you script.

vf category (very simple, not rounding anything):

Code: Select all

{def h = video.height as int; h > 1000 ? 1080 : h > 700 ? 720 : h > 400 ? 480 : 360}p
sdhd:

Code: Select all

{def h = video.height as int; h > 480 ? "HD" : "SD"}
Note: {sdhd} binding requires video.height >= 720

EDIT:
Here's a very non-math-heavy version of rounding up :P

Code: Select all

{for (h = video.height as int; h <= 1080; h++) {if ([1080, 720, 480, 360].contains(h)) return h}}

Re: Strange values for video format (vf)

Posted: 07 Jun 2012, 02:36
by larsser15
So I feel that I'm only interested in 1080p and 720p, and anything less, I'll just call SD, so I came up with this slight modification.

Code: Select all

{def h = video.height as int; h >1000 ? "1080p" : h > 700 ? "720p" : h > 400 ? "480p" : "SD"}
Code wise, I've only dabbled in Visual Basic, so I'm a newb. :ugeek:

Re: Strange values for video format (vf)

Posted: 23 Jun 2012, 08:57
by Eterimos
FYI I found the following thresholds more useful because you may have 1080p with cropped black bars, so less than 1000 vertical pixels but it should still be considered 1080p in the file naming.

Code: Select all

{def h = video.height as int; h > 720 ? 1080 : h > 480 ? 720 : 480}p
These are the naming schemes for series and movies I'm using.

Code: Select all

{n.space('.')}.{'S'+s.pad(2)}E{e.pad(2)}.{t.space('.')}.{def h = video.height as int; h > 720 ? 1080 : h > 480 ? 720 : 480}p{".$source"}{".$vc"}{"-$group"}

{n.space('.')}.{y}.{def h = video.height as int; h > 720 ? 1080 : h > 480 ? 720 : 480}p{".$source"}{".$vc"}{"-$group"}

Re: Strange values for video format (vf)

Posted: 24 Mar 2013, 10:04
by tonkatsu
I've got a movie with a resolution of : 1280X534. It's supossed to be 720p, but if i only evaluate the height (534<700) it cannot be considered 720p.... maybe the width can be a important variable?

Re: Strange values for video format (vf)

Posted: 24 Mar 2013, 13:42
by rednoah
tonkatsu wrote:I've got a movie with a resolution of : 1280X534. It's supossed to be 720p, but if i only evaluate the height (534<700) it cannot be considered 720p.... maybe the width can be a important variable?
Fixed with r1551.

Re: Strange values for video format (vf)

Posted: 06 Nov 2013, 19:32
by Northys
I think that this is the best solution, because a lot of movies aren't 16:9 (1920x1080) but the height is smaller so I started to use width to get the "p" quality:

Code: Select all

{def w = video.width as int; w > 1900 ? "1080p" : w > 1200 ? "720p" : "SD"}
1900px and more width = 1080p
1200px and more width = 720p
the others = SD

Re: Strange values for video format (vf)

Posted: 07 Nov 2013, 02:08
by rednoah
Looks good!

With newer versions you can write it like this:

Code: Select all

{dim[0] > 1900 ? "1080p" : dim[0] > 1200 ? "720p" : "SD"}

Re: Strange values for video format (vf)

Posted: 20 Apr 2017, 17:58
by gregsterb
Does this actually pull the data from the video file to give it the name? I made a large mistake and renamed my entire collection to this format "The Book of Life 2014 [Romance, 7.3, PG]". Now I wish I had of include more information on the video type.

Re: Strange values for video format (vf)

Posted: 20 Apr 2017, 18:25
by rednoah
Yes. The only source for that kind of information is the file itself.

You can make a Plain File Preset to add some extra information to the file name with a format such as this:

Code: Select all

{fn} {[vf, vc, ac]}