filebot and mkvpropedit

Support for Ubuntu and other Desktop Linux distributions
Post Reply
Cyb3rGh05t
Posts: 29
Joined: 17 May 2019, 11:47

filebot and mkvpropedit

Post by Cyb3rGh05t »

Hi,

i have a question about filebot and mkvpropedit.
I read somewhere that filebot can make use of mkvpropedit, if this is true is there a way how it could change the language tag of a movie file after being renamed with filebot?

Thanks
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot and mkvpropedit

Post by rednoah »

There's a script that will write xattr metadata to mp4 files:
viewtopic.php?p=44992#p44992


You won't have much luck with mkv files though, since mkvpropedit can only set the title property:
https://github.com/filebot/scripts/blob ... .groovy#L9


:?: Can mkvpropedit set the language tag?
:idea: Please read the FAQ and How to Request Help.
Cyb3rGh05t
Posts: 29
Joined: 17 May 2019, 11:47

Re: filebot and mkvpropedit

Post by Cyb3rGh05t »

rednoah wrote: 24 Jan 2020, 19:02 :?: Can mkvpropedit set the language tag?
Yes,

Code: Select all

find /path/to/mediafiles/ . -iname "*.mkv" -exec mkvpropedit {} --delete title --edit track:v1 --set language=eng --set flag-forced=0 --delete name --edit track:a1 --set language=ger --set flag-forced=1 --delete name \;
Thats how i am using it to change language tags without a complete remuxx of the file
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot and mkvpropedit

Post by rednoah »

:arrow: Just use filebot -exec then, it's kinda like find -exec but FileBot-powered:

Code: Select all

filebot -mediainfo -r . --file-filter "ext == /mkv/" -exec mkvpropedit {f} --delete title --edit track:v1 --set language={languages[0]} --set flag-forced=0 --delete name --edit track:a1 --set language={audioLanguages[0]} --set flag-forced=1 --delete name

:idea: Notably, in this example, {languages} is based on xattr metadata, while {audioLanguages} is based on MediaInfo (and thus fail if the file isn't already tagged).
:idea: Please read the FAQ and How to Request Help.
Cyb3rGh05t
Posts: 29
Joined: 17 May 2019, 11:47

Re: filebot and mkvpropedit

Post by Cyb3rGh05t »

all right, but i have specify a input folder no?

Code: Select all

filebot -mediainfo -r . --file-filter "ext == /mkv/" -exec mkvpropedit {f} --delete title --edit track:v1 --set language={languages[0]} --set flag-forced=0 --delete name --edit track:a1 --set language={audioLanguages[0]} --set flag-forced=1 --delete name
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot and mkvpropedit

Post by rednoah »

In this example, . (i.e. current working directory) is the input folder. You can use absolute paths if you prefer that. ;)



EDIT:

Best to start testing things with echo:

Code: Select all

filebot ... -exec echo {f} ... --set language={languages[0]} ... --set language={audioLanguages[0]}
:idea: Please read the FAQ and How to Request Help.
Cyb3rGh05t
Posts: 29
Joined: 17 May 2019, 11:47

Re: filebot and mkvpropedit

Post by Cyb3rGh05t »

thanks,

so i could go with :

Code: Select all

filebot /mnt/renamed/movies/ -mediainfo -r . --file-filter "ext == /mkv/" -exec mkvpropedit {f} --delete title --edit track:v1 --set language=eng --set flag-forced=0 --delete name --edit track:a1 --set language=ger --set flag-forced=1 --delete name --log-file /var/plexguide/filebot.log
 
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot and mkvpropedit

Post by rednoah »

You're now passing both . as well as /mnt/renamed/movies/ as input folder... You're probably fine with just the latter.


:idea: You're already using find . so I'm assuming you kinda know what . means, no? :lol:


:idea: -exec must be your last FileBot option. You can't add --log-file at the end. Well, you can, but then mkvpropedit is going to be very confused. :lol:
:idea: Please read the FAQ and How to Request Help.
Cyb3rGh05t
Posts: 29
Joined: 17 May 2019, 11:47

Re: filebot and mkvpropedit

Post by Cyb3rGh05t »

all right thanks :)
Cyb3rGh05t
Posts: 29
Joined: 17 May 2019, 11:47

Re: filebot and mkvpropedit

Post by Cyb3rGh05t »

could you maybe help me out to edit the code?

i dont get how to tell it to look for undefinied "UND" tracks and if there is one then it changes it to "GER"?

thanks for helping
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: filebot and mkvpropedit

Post by rednoah »

You can use --file-filter to only select specific files (e.g. files with UND audio tracks) and the rest is just mkvpropedit.
:idea: Please read the FAQ and How to Request Help.
Cyb3rGh05t
Posts: 29
Joined: 17 May 2019, 11:47

Re: filebot and mkvpropedit

Post by Cyb3rGh05t »

ok thanks again :)
Post Reply