Media files tagger

Discuss and share scripts and script files...
amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

highend wrote: 03 Nov 2020 17:31 That's exactly the info which was expected from mediainfo. When you remove that line again and rerun that script, is the entry for it in the tag.dat file correct?
I removed it and ran the script again. The result is the same weird result!

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Search for and tag video files [custom columns]

Post by highend »

Replace the line text $result; end true; with:
$result = replacelist($result, "|<::>,", "/<::>;", "<::>");

Run it again, fixed?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

highend wrote: 03 Nov 2020 17:46 Replace the line text $result; end true; with:
$result = replacelist($result, "|<::>,", "/<::>;", "<::>");

Run it again, fixed?
Yeah. Fixed! :tup: :tup: :tup: :tup: :tup: :tup:

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

What was the issue?

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Search for and tag video files [custom columns]

Post by highend »

Probably the defined tag separator in XY.

Value of TagsSeparator= in your XYplorer.ini?
Probably the comma...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

highend wrote: 03 Nov 2020 17:58 Probably the defined tag separator in XY.

Value of TagsSeparator= in your XYplorer.ini?
Probably the comma...
At the moment the value of TagsSeparator in my XYplorer.ini is empty. Should I define a value for that?
If yes, what's the best separator value for TagsSeparator to avoid such conflicts?

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Search for and tag video files [custom columns]

Post by highend »

No, don't change it.
The best option will be to make the replacement in the script. I'll take care of that.
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

I found a bug associated with multiple streams. Although all information is tagged and available in "tag.dat", only the info from the first stream is passed to the column through the current custom script: return gettoken(tagitems("tags",, <cc_item>), <x>, "#::#");

Command line:

Code: Select all

C:\Program Files\MediaInfo_CLI_20.09_Windows_x64>MediaInfo.exe --inform=Audio;%Channel(s)%/ "Z:\Test - Test\The Craft Legacy (2020) WEBRip-1080p [10-Bit][x265][AAC 5.1][TMDB-590995].mp4"
2/6/

C:\Program Files\MediaInfo_CLI_20.09_Windows_x64>MediaInfo.exe --inform=Audio;%Title%/ "Z:\Test - Test\The Craft Legacy (2020) WEBRip-1080p [10-Bit][x265][AAC 5.1][TMDB-590995].mp4"
Stereo / Stereo/5.1 Channel / 5.1 Channel/

C:\Program Files\MediaInfo_CLI_20.09_Windows_x64>MediaInfo.exe --inform=Audio;%BitRate/String%- "Z:\Test - Test\The Craft Legacy (2020) WEBRip-1080p [10-Bit][x265][AAC 5.1][TMDB-590995].mp4"
256 kb/s-224 kb/s-
Contents stored in "tag.dat":

Code: Select all

Z:\Test - Test\The Craft Legacy (2020) WEBRip-1080p [10-Bit][x265][AAC 5.1][TMDB-590995].mp4|0|01:34:22.890#::#2/1//Yes#::#English / English#::#AC-3 / AAC LC#::#HEVC#::#The Craft: Legacy#::#Horror#::#Zoe Lister-Jones#::#Cailee Spaeny / Zoey Luna / Гидеон Адлон / Lovie Simone / David Duchovny#::#An eclectic foursome of aspiring teenage witches get more than they bargained for as they lean into their newfound powers.#::#1920x800#::#23.976#::#2.40:1#::#FHD / FHD#::#2 000 kb/s#::#2/#::#Stereo / Stereo/#::#256 kb/s-#::#6/#::#5.1 Channel / 5.1 Channel/#::#224 kb/s-#::#
And the final column in XYplorer is shown in the attached photo.
Attachments
columns.jpg
columns.jpg (44.27 KiB) Viewed 2246 times

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

Attributes:

Code: Select all

    $SEP = "#::#";
    $attributes = <<<>>>
General;%Duration/String3%$SEP%AudioCount%/%VideoCount%/%TextCount%/%Cover%$SEP%Audio_Language_List%$SEP%Audio_Format_List%$SEP%Video_Format_List%$SEP%Title%$SEP%Genre%$SEP%Director%$SEP%Actor%$SEP%LongDescription%$SEP
Video;%Width%x%Height%$SEP%FrameRate%$SEP%DisplayAspectRatio/String%$SEP%Title%$SEP%BitRate/String%$SEP
Audio;%Channel(s)%/$SEP%Title%/$SEP%BitRate/String%-$SEP
    >>>;
Scripts for each column accordingly:

Code: Select all

return gettoken(tagitems("tags",, <cc_item>), 16, "#::#");
return gettoken(tagitems("tags",, <cc_item>), 17, "#::#");
return gettoken(tagitems("tags",, <cc_item>), 18, "#::#");

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Search for and tag video files [custom columns]

Post by highend »

The tagged data may be there but look at the end of it, the values are not in the same field, but separated by multiple ones

I guess that's because of your template entries

Code: Select all

Audio;%Channel(s)%/$SEP%Title%/$SEP%BitRate/String%-$SEP
You have forward slashes outside of attribute definitions which probably act as separators in what mediainfo finally produces...

Code: Select all

Audio;%Channel(s)%$SEP%Title%$SEP%BitRate/String%$SEP
Use this and try again...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

highend wrote: 03 Nov 2020 21:25 The tagged data may be there but look at the end of it, the values are not in the same field, but separated by multiple ones

I guess that's because of your template entries

Code: Select all

Audio;%Channel(s)%/$SEP%Title%/$SEP%BitRate/String%-$SEP
You have forward slashes outside of attribute definitions which probably act as separators in what mediainfo finally produces...

Code: Select all

Audio;%Channel(s)%$SEP%Title%$SEP%BitRate/String%$SEP
Use this and try again...
I have already tried it. I checked once more. Removing the separators makes no difference in the final column results.
And the reason for using the separators in the first place is due to the weird behavior of MediaInfo CLI in displaying the results. Look at these commands and see the results without separators:

Code: Select all

C:\Program Files\MediaInfo_CLI_20.09_Windows_x64>MediaInfo.exe --inform=Audio;%Channel(s)% "Z:\Test - Test\The Craft Legacy (2020) WEBRip-1080p [10-Bit][x265][AAC 5.1][TMDB-590995].mp4"
26

C:\Program Files\MediaInfo_CLI_20.09_Windows_x64>MediaInfo.exe --inform=Audio;%Title% "Z:\Test - Test\The Craft Legacy (2020) WEBRip-1080p [10-Bit][x265][AAC 5.1][TMDB-590995].mp4"
Stereo / Stereo5.1 Channel / 5.1 Channel

C:\Program Files\MediaInfo_CLI_20.09_Windows_x64>MediaInfo.exe --inform=Audio;%BitRate/String% "Z:\Test - Test\The Craft Legacy (2020) WEBRip-1080p [10-Bit][x265][AAC 5.1][TMDB-590995].mp4"
256 kb/s224 kb/s
I could not find a way to retrieve the information of different channels separately through MediaInfo CLI. And the regular commands as shown above, if there are multiple streams, will results in the output which includes all information without any separators. This behavior of MediaInfo CLI results in odd and misleading values for some parameters such as %Channel(s)%. For example here the output for the number of channels is: 26.

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Search for and tag video files [custom columns]

Post by highend »

I would need that file to properly debug that problem...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

highend wrote: 03 Nov 2020 22:02 I would need that file to properly debug that problem...
I sent the link to the file.

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

Re: Search for and tag video files [custom columns]

Post by highend »

MediaInfo behaves correctly.

It outputs these attributes per stream...

Code: Select all

Audio #1
2/#::#Stereo / Stereo/#::#256 kb/s-#::#

Code: Select all

Audio #2
6/#::#5.1 Channel / 5.1 Channel/#::#224 kb/s-#::#
And the full output is just a concatenation of the two.

The same would happen if there is more than one subtitle, more than one videostream (is that even possible?)...

This can eventually be solved by identifying such patterns and merging the belonging components into the same field but this requires some serious thinking.

Do have any video file with
a.) At least two audio streams
+
b.) Minimum of three subtitle streams

that you could share?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

amirvf
Posts: 133
Joined: 18 Oct 2020 00:46

Re: Search for and tag video files [custom columns]

Post by amirvf »

highend wrote: 04 Nov 2020 00:53 MediaInfo behaves correctly.

It outputs these attributes per stream...

Code: Select all

Audio #1
2/#::#Stereo / Stereo/#::#256 kb/s-#::#

Code: Select all

Audio #2
6/#::#5.1 Channel / 5.1 Channel/#::#224 kb/s-#::#
And the full output is just a concatenation of the two.

The same would happen if there is more than one subtitle, more than one videostream (is that even possible?)...

This can eventually be solved by identifying such patterns and merging the belonging components into the same field but this requires some serious thinking.

Do have any video file with
a.) At least two audio streams
+
b.) Minimum of three subtitle streams

that you could share?
I have made 2 video files:
1. A Video with 4 Audio Streams and 3 Subtitle Streams
2. A Video with 3 Audio Streams and 5 Subtitle Streams

Let me know if it works or not. I can make any combinations.

Post Reply