The site i use for TV is now starting to release X265 versions of shows, which are significantly smaller in size, however these are usually a bit behind the main releases. If i set filebot to "Replace if better" it will discard these ffiles, and if i select always overwrite, it will take them, but if a subsequent larger release, say at the end of the series, is release, they'll overwrite again.
Can the replace if better be improved to take into account the format? or is there a way i can prefer HEVC / lower file size?
Custom --conflict action to prefer HEVC over AVC
-
- Posts: 18
- Joined: 14 Jan 2018, 15:15
Re: Overwrite for TV episodes
A.
No, because --conflict auto only works with comparable (i.e. numbers) media properties, e.g. resolution, bitrate, file size, etc.
B.
Yes, because you can write your own Conflict Action and have your own custom code decide what to do about any given pair of files:
viewtopic.php?t=12891
Some coding expertise required. This is an advanced feature that was added in FileBot 5.* so you will not find copy & paste examples yet.
I'm happy to support a community effort if someone wants to take the time to develop (and maintain) a "smart conflict action" that takes into account video codec, audio codec, and other non-numeric properties, that can then be shared to (and modified by) end users.
No, because --conflict auto only works with comparable (i.e. numbers) media properties, e.g. resolution, bitrate, file size, etc.
B.
Yes, because you can write your own Conflict Action and have your own custom code decide what to do about any given pair of files:
viewtopic.php?t=12891
Some coding expertise required. This is an advanced feature that was added in FileBot 5.* so you will not find copy & paste examples yet.
I'm happy to support a community effort if someone wants to take the time to develop (and maintain) a "smart conflict action" that takes into account video codec, audio codec, and other non-numeric properties, that can then be shared to (and modified by) end users.
Please read the FAQ and How to Request Help.
-
- Posts: 18
- Joined: 14 Jan 2018, 15:15
Re: Overwrite for TV episodes (Custom Conflict Action)
I dont think i have the expertise to develop this, but im happy to test and review it
Re: Overwrite for TV episodes (Custom Conflict Action)
e.g. custom --conflict action that prefers HEVC over AVC:
Note that this code only works for HEVC / AVC and any other video codec is always considered inferior.
Note that this code does not take file size, bitrate, etc into consideration at all, i.e. a small HEVC file is considered equal to a large HEVC file.
MAKE SURE TO RUN YOUR OWN TESTS WITH SAMPLE FILES BEFORE USING THIS CODE IN PRODUCTION because you may overwrite the wrong file if the code doesn't work as intended.
Code: Select all
--conflict /path/to/VideoCodecOrder.groovy
Code: Select all
{ from, to ->
def score = { f ->
['HEVC':20, 'AVC':10][f.mediaCharacteristics.videoCodec] ?: 0
}
score(from) > score(to) ? to : null
}
Note that this code only works for HEVC / AVC and any other video codec is always considered inferior.
Note that this code does not take file size, bitrate, etc into consideration at all, i.e. a small HEVC file is considered equal to a large HEVC file.
MAKE SURE TO RUN YOUR OWN TESTS WITH SAMPLE FILES BEFORE USING THIS CODE IN PRODUCTION because you may overwrite the wrong file if the code doesn't work as intended.
Please read the FAQ and How to Request Help.
-
- Posts: 18
- Joined: 14 Jan 2018, 15:15
Re: Custom --conflict action to prefer HEVC over AVC
I use filebot node on Synology, can i use this code on there?
Re: Custom --conflict action to prefer HEVC over AVC
Sorry, no. The FileBot Node WebUI uses a combo box with fixed values, so you can't pass along custom Groovy code as --conflict option value.
Please read the FAQ and How to Request Help.
-
- Posts: 18
- Joined: 14 Jan 2018, 15:15
Re: Custom --conflict action to prefer HEVC over AVC
Any chance this could be added to node?
Re: Custom --conflict action to prefer HEVC over AVC
Future versions of FileBot Node will make the combobox editable, so that you can specify inline Groovy code or a file path. However, a new version of FileBot Node will not be released anytime soon since we don't have any major changes or features that would warrant a new release.
Please read the FAQ and How to Request Help.
-
- Posts: 18
- Joined: 14 Jan 2018, 15:15
Re: Custom --conflict action to prefer HEVC over AVC
I've now tested the code you placed above, and it worked perfectly. I used the code that Node put in the window, and put it in a scheduled task in Synology, with the added conflict bit, and worked a treat
Code: Select all
[VideoCodecOrder.groovy] Delete [/volume2/video/TV Shows/For All Mankind/Season 04/For All Mankind - S04E04 - House Divided.mkv]
[MOVE] from [/volume2/video/Downloads/For.All.Mankind.S04E04.1080p.x265.mkv] to [/volume2/video/TV Shows/For All Mankind/Season 04/For All Mankind - S04E04 - House Divided.mkv]