MediaInfo Inspector

All about user-defined episode / movie format expressions
Post Reply
User avatar
rednoah
The Source
Posts: 16419
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

MediaInfo Inspector

Post by rednoah » 05 Nov 2016, 14:58

FileBot uses MediaInfo Image to read properties like {vc}, {ac}, {channels}, {resolution}, etc from the container file. You can access any MediaInfo property directly via the {general}, {video}, {audio} and {text} bindings.

e.g. get Format_Profile property from the first video stream:

Code: Select all

{video[0].FormatProfile}
Image
:idea: Open FileBot Image ➔ Edit Format Image ➔ Change Sample Image ➔ Open MediaInfo Image


If you have issues with MediaInfo bindings such as {vc}, {ac}, {channels}, {resolution}, {duration}, etc check the raw MediaInfo data to see what FileBot sees.
:idea: Please read the FAQ and How to Request Help.

weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 » 05 Dec 2018, 08:09

Hi,

my expression is :

Code: Select all

{s00e00} - {t} ({resolution}_{kbps}_{vc}_{channels}_{ac}_{source}_{languages}_{lang}_{subt})
1/my 1st question is :
where does Filebot take the informations {source}, {languages}, {lang} and {subt} from ? MediaInfo for all of them ?

indeed, I have plenty of cartoons and when I look at them with MediaInfo, most of them don't have the language set, neither the source, and when i apply the expression, i get "fra" as language --> why ?

2/I don't see how Filebot could retrieve the "source", as i never saw it in MediaInfo --> does it come from MediaInfo ??? how can i set it in the cartoons ? with which tool ?

thank you very much in advance for your reply

regards

EDIT :
I found mkvtoolnix to set the language, but i don't see how to set the "source" :-(
Last edited by weyb06 on 05 Dec 2018, 13:55, edited 1 time in total.

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

Re: MediaInfo Inspector

Post by rednoah » 05 Dec 2018, 09:20

weyb06 wrote:
05 Dec 2018, 08:09
where does Filebot take the informations {source}, {languages}, {lang} and {subt} from ? MediaInfo for all of them ?
Does NOT use MediaInfo:
{source} is based on the file path only, matching kown patterns such as BluRay.
{lang} and {subt} is for subtitles, matching the subtitle language suffix from the file path, or by running statistical language detection on the file contents of text-based subtitle files.

Does use MediaInfo:
{languages} is a convenience binding for reading audio languages (via libmediainfo or ffprobe depending on your install).

weyb06 wrote:
05 Dec 2018, 08:09
I don't see how Filebot could retrieve the "source", as i never saw it in MediaInfo --> does it come from MediaInfo ??? how can i set it in the cartoons ? with which tool ?
If the filename doesn't say Bluray / DVDRip / WebDL / etc then {source} won't work. If you just have the video file, then it's impossible to tell if it came from BD / DVD / Netflix / iTunes / etc. You could guess based on file size / resolution / bitrate / etc in your own format code but it's ultimately guesswork unless the file is explicitly tagged in some way.
:idea: Please read the FAQ and How to Request Help.

weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 » 05 Dec 2018, 14:01

hi,

thank you for your reply !
i understand a little better how it works !

I found mkvtoolnix to set the language, but i don't see how to set the "source"
--> which property could i set (with mkvtoolnix) as the "source" so filebot recognizes/reads it with MediaInfo (and then afterwards i'll be able to get it), please ?
--> I mean to use a property i don't use to set the "source"...

EDIT : you should precise on https://www.filebot.net/naming.html that {lang} is for subtitles only ;-)

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

Re: MediaInfo Inspector

Post by rednoah » 05 Dec 2018, 14:37

{source} only works if a known keyword such as BluRay appears in the file path. mkvtoolnix doesn't help you there. Presumably, you can add your own custom tags though, which will then be accessible via mediainfo.

EDIT: I'll be making changes to FileBot 4.8.5 also check the media title (e.g. from mkv title tag if available) as well for bindings such as {source} that are based on the current or original filename.
:idea: Please read the FAQ and How to Request Help.

weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 » 05 Dec 2018, 15:01

If i set the Mediainfo "Encoded_Library/String" parameter with "VHS" for example, how can i retrieve/read it with filebot ?
I saw there is "media" able to get <any any general media parameter>, but how do i do that please ? {media} is enough ?

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

Re: MediaInfo Inspector

Post by rednoah » 05 Dec 2018, 15:53

You can access any media info property by name.

Object/Property style:

Code: Select all

media.EncodedLibraryString
Map/Key style:

Code: Select all

media['Encoded_Library/String']
:idea: Please read the FAQ and How to Request Help.

weyb06
Posts: 7
Joined: 02 Nov 2018, 16:24

Re: MediaInfo Inspector

Post by weyb06 » 05 Dec 2018, 16:42

ok i get it !

Q : i have set the language with mkvtoolnix, and i can see "Language/String: en" in the audio section of Mediainfo, so why do i get [fra] with {languages} in my expression ?

regards

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

Re: MediaInfo Inspector

Post by rednoah » 06 Dec 2018, 00:15

Correction:

{languages} is the TheTVDB language / TheMovieDB spoken languages field.

{audioLanguages} is the convenience binding for accessing audio languages (as List of Language objects).

{audio.LanguageString} is direct access for the Language/String value for each audio stream.
:idea: Please read the FAQ and How to Request Help.

shreyas1122
Posts: 2
Joined: 19 Apr 2017, 01:31

Re: MediaInfo Inspector

Post by shreyas1122 » 02 Mar 2019, 13:25

I would like to use {video[0].frameRate} in an IF condition, I'm not able to figure out how to do it.
i tried printing the framerate on the gui and then comparing as float num and string, but it always returns a 'false' : {video[0].frameRate > 1.0 }

Any help ??
Thanks (Y)

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

Re: MediaInfo Inspector

Post by rednoah » 02 Mar 2019, 13:38

You'll need to convert the String value to a Number before can compare it numerically:

Code: Select all

video[0].frameRate.toFloat() > 1.0
:idea: Please read the FAQ and How to Request Help.

redbull666
Donor
Posts: 42
Joined: 08 Jan 2014, 20:45

Re: MediaInfo Inspector

Post by redbull666 » 09 Jun 2019, 07:12

Lately I am seeing more releases of which I cannot seem to get a useful {source} extracted.

Example 1 (OK): https://paste.gg/p/anonymous/f8d52f198a ... d6402ffae3 (seen in the BluRay-1080p tag)
Example 2 (not OK) https://paste.gg/p/anonymous/8691f9399e ... 949c3ebbf2 (see the -2160p tag)

I wonder why 1 works, and not 2. What is different exactly?

I updated Mediainfo to the repo provided by Mediainfo, but that was after, not sure that helps.

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

Re: MediaInfo Inspector

Post by rednoah » 09 Jun 2019, 07:37

{source} is not a MediaInfo binding. {source} is based primary on the filename, i.e. if the filename contains BluRay then {source} will be BluRay, if the filename is abc.mp4 then {source} will be undefined.
:idea: Please read the FAQ and How to Request Help.

redbull666
Donor
Posts: 42
Joined: 08 Jan 2014, 20:45

Re: MediaInfo Inspector

Post by redbull666 » 10 Jun 2019, 15:25

rednoah wrote:
09 Jun 2019, 07:37
{source} is not a MediaInfo binding. {source} is based primary on the filename, i.e. if the filename contains BluRay then {source} will be BluRay, if the filename is abc.mp4 then {source} will be undefined.
Aaah ok, still I did not get a valid source from the release with this filename:

Django Unchained (2012) (1080p BluRay x265 HEVC 10bit AAC 5.1 Silence)

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

Re: MediaInfo Inspector

Post by rednoah » 10 Jun 2019, 15:50

{source} does work for this one:

Code: Select all

$ filebot -mediainfo . --format "[{source}] {fn}"
[BluRay] Django Unchained (2012) (1080p BluRay x265 HEVC 10bit AAC 5.1 Silence)
:idea: Please read the FAQ and How to Request Help.

redbull666
Donor
Posts: 42
Joined: 08 Jan 2014, 20:45

Re: MediaInfo Inspector

Post by redbull666 » 10 Jun 2019, 15:59

rednoah wrote:
10 Jun 2019, 15:50
{source} does work for this one:

Code: Select all

$ filebot -mediainfo . --format "[{source}] {fn}"
[BluRay] Django Unchained (2012) (1080p BluRay x265 HEVC 10bit AAC 5.1 Silence)
Right, I should have looked closer in the log...
Auto-detect movie from context: [/mnt/slow/torrents/media_downloads/Django Unchained (2012) (1080p BluRay x265 HEVC 10bit AAC 5.1 Silence)/Featurettes/The Costume Designs of Sharen Davis.mkv]
[HARDLINK] from [/mnt/slow/torrents/media_downloads/Django Unchained (2012) (1080p BluRay x265 HEVC 10bit AAC 5.1 Silence)/Django Unchained (2012) (1080p BluRay x265 Silence).mkv] to [/mnt/slow/media/Movies/Django Unchained (2012)/Django Unchained (2012) [x265, Blu-ray-1080p, AAC-5.1, KRaLiMaRKo].mkv]
[HARDLINK] from [/mnt/slow/torrents/media_downloads/Django Unchained (2012) (1080p BluRay x265 HEVC 10bit AAC 5.1 Silence)/Featurettes/Reimagining the Spaghetti - Western The Horses And Stunts of Django Unchained.mkv] to [/mnt/slow/media/Movies/Django Unchained (2012)/Django Unchained (2012) [x265, -1080p, AAC-2.0, ].mkv]
[OVERRIDE] Delete [/mnt/slow/media/Movies/Django Unchained (2012)/Django Unchained (2012) [x265, -1080p, AAC-2.0, ].mkv]
Some shitty Featurettes messed with this one...

Thanks for the help!

Post Reply