Add UHD label to 4K video files

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
trininja
Posts: 14
Joined: 08 Oct 2019, 12:29

Add UHD label to 4K video files

Post by trininja »

Maybe I am just to blind to get it.

I read a lot about formating your string and I have seen the most weird strings that lead to really fascinating results, but I need it simple and plain. And I do not understand how I can do it with Filebot Node.

My syntax for movies is simple as hell:

Code: Select all

{n.ascii()} ({y})/{n.ascii()} ({y})
Plain and simple. But I want something special for 4K files: if it is a 4K file add the word UHD with a trailing space at the end behind the year in path and filename. Nothing more, nothing less. If it is HD or SD or 3D, do nothing. I wasn't able to figure out how I can do this simple thing. I have found a lot of things about to add all vc tags or sort them into x:video4k, but that's not what I want.

Any suggestions?

And hi btw. I am new and I love FileBot, just bought a license ;)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Beginner question - appending a word depending on format

Post by rednoah »

e.g. Groovy snippet:

Code: Select all

width > 4000 ? 'UHD' : null
e.g. Complete Format:

Code: Select all

{ny.ascii()}/{ny.ascii()}{width > 4000 ? ' UHD' : null}
:idea: Please read the FAQ and How to Request Help.
trininja
Posts: 14
Joined: 08 Oct 2019, 12:29

Re: Add UHD label to 4K video files

Post by trininja »

Hm, I did a dryrun in FileBot Node on my Synology (MediaInfo is installed) and it doesn't work. Even when I lower the value from 4000 to 3000 (4K is min. 3.840 x 2.160 and UHD is 4.096 x 2.160, so I want to filter both sizes, I lower the value to 3000 for every occasion.) the files don't get the UHD name.

Code: Select all

Parameter: movieFormat = {n.ascii()} ({y}) {width > 3000 ? 'UHD' : null}/{n.ascii()} ({y}) {width > 3000 ? 'UHD' : null}
Inputfiles are mixed 720p 1080p 4k and UHD files to test it, all got flat sorted without the UHD naming for the 4K and UHD files.

Any other ideas?

And thank you for your efforts.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Add UHD label to 4K video files

Post by rednoah »

Change to {width} and see what value you get.

You can use filebot -script fn:sysinfo to check if MediaInfo is working in general.
:idea: Please read the FAQ and How to Request Help.
trininja
Posts: 14
Joined: 08 Oct 2019, 12:29

Re: Add UHD label to 4K video files

Post by trininja »

Seems MediaInfo is not loaded.

Code: Select all

FileBot 4.8.5 (r6224)
Java HotSpot(TM) Embedded Client VM warning: You have loaded library /volume1/@appstore/filebot/lib/x86_64/libjnidispatch.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
JNA Native: java.lang.UnsatisfiedLinkError: Could not find JNA native support
MediaInfo: net.filebot.mediainfo.MediaInfoException: Unable to load i386 (32-bit) native library libmediainfo.so: Could not initialize class com.sun.jna.Native
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: /volume1/@appstore/filebot/lib/x86_64/lib7-Zip-JBinding.so: /volume1/@appstore/filebot/lib/x86_64/lib7-Zip-JBinding.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
Chromaprint: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-05-15 (r565)
Groovy: 2.5.6
JRE: Java(TM) SE Embedded Runtime Environment 1.8.0
JVM: 32-bit Java HotSpot(TM) Embedded Client VM
CPU/MEM: 4 Core / 239 MB Max Memory / 10 MB Used Memory
OS: Linux (i386)
HW: Linux MasterStore 3.10.105 #24922 SMP Wed Jul 3 16:35:48 CST 2019 x86_64 GNU/Linux synology_cedarview_1812+
DATA: /volume1/@appstore/filebot/data/admin
Package: SPK
License: FileBot License P9671722 (Valid-Until: 2020-10-14)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Add UHD label to 4K video files

Post by rednoah »

If JNA is not working, then MediaInfo can't work either:

Code: Select all

Java HotSpot(TM) Embedded Client VM warning: You have loaded library /volume1/@appstore/filebot/lib/x86_64/libjnidispatch.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
JNA Native: java.lang.UnsatisfiedLinkError: Could not find JNA native support
Sorry, but it looks like you'll have to live without MediaInfo on this particular device. JNA just isn't compatible.

:idea: You may find a solution via Google though. Maybe cross-compile JNA for your particular CPU architecture. But this is not really an option for normal users.

:idea: I'd just use the GUI on your Desktop. You probably won't be able to get JNA working on your device, so you won't be able to use MediaInfo bindings on this particular device.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Add UHD label to 4K video files

Post by rednoah »

Wait, this is fcked up:

Code: Select all

OS: Linux (i386)
HW: Linux MasterStore 3.10.105 #24922 SMP Wed Jul 3 16:35:48 CST 2019 x86_64 GNU/Linux synology_cedarview_1812+
:?: Why is there 32-bit Java running on a 64-bit machine?

:!: Uninstall all 32-bit Java and only install 64-bit Java. If you're lucky, then that'll fix all the issues you're having with 64-bit native libs not loading.


EDIT:

Nevermind... I read your latest post now. It's now showing amd64 and i386, and MediaInfo is working now, so I guess that was the root cause of the issue.
:idea: Please read the FAQ and How to Request Help.
trininja
Posts: 14
Joined: 08 Oct 2019, 12:29

Re: Add UHD label to 4K video files

Post by trininja »

Ah, yeah, now I run into other troubles. *Sigh* never thought FileBot is that mighty and complex. And great. :) I hope I have enough brainpower to understand at least 1% of what I want to achieve or FileBot is capable of.

And the 32/64 trouble was caused by whatever over the years with ipkg, manual install unclean uninstallers and so on. The refresh install of DSM fixed that :)
Post Reply