Page 1 of 1
filebot and mkvpropedit
Posted: 24 Jan 2020, 18:17
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
Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:02
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?
Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:14
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
Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:26
by rednoah

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

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).
Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:37
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
Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:38
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]}
Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:42
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
Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:46
by rednoah
You're now passing
both . as well as
/mnt/renamed/movies/ as input folder... You're probably fine with just the latter.

You're already using
find . so I'm assuming you kinda know what
. means, no?
-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.

Re: filebot and mkvpropedit
Posted: 24 Jan 2020, 19:51
by Cyb3rGh05t
all right thanks

Re: filebot and mkvpropedit
Posted: 25 Jan 2020, 15:04
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
Re: filebot and mkvpropedit
Posted: 25 Jan 2020, 18:18
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.
Re: filebot and mkvpropedit
Posted: 25 Jan 2020, 18:36
by Cyb3rGh05t
ok thanks again
