INTERACT FORUM
More => Old Versions => JRiver Media Center 30 for Windows => Topic started by: cowboydude99 on November 23, 2022, 02:13:26 pm
-
Hi there,
I am looking for some help/ideas on how to accomplish setting a tag in one field, based on the results of another.
I have a field called 'Audio Codex Play', which tells MC what codec video to play when I use 'ShowTime'.
I manually populate this field with "Dolby Atmos" or some other codec depending on the source audio codec.
I get this information by running SoT (Swag of Tools) to get the media info.
-Running this adds the codec to the end of the Compression field in MC.
If the compression field contains 'Atmos', I want to automatically set the Audio Codex Play tag to "Dolby Atmos".
Does MC have a core command or some other way to query and write tag values?
-
You could e.g. make your 'Audio Codex Play' field a calculated field with rule
if(IsEqual([Compression],atmos,8),Dolby Atmos,)
Meaning if compression field has string atmos then show Atmos. This is just an example and rule can be expanded to show also other stuff sourced from Compression field or from more SoT scraped mediainfo fields
-
Hi! Thank you.
Is there a reference I could read through to expand this function?
I have multiple IF statements, but I'm not sure how to get this to work. Missing character or something?
if(IsEqual([Compression],+atmos,8),Dolby Atmos,)
if(IsEqual([Compression],truehd,8),Dolby TrueHD,)
if(IsEqual([Compression],ac3,8),Dolby Digital,)
-
You may use ifelse structure here:
IfElse(
IsEqual([Compression],+atmos,8),
Dolby Atmos,
IsEqual([Compression],truehd,8),
Dolby TrueHD,
IsEqual([Compression],ac3,8),
Dolby Digital
)
https://wiki.jriver.com/index.php/Conditional_Functions#IfElse
You could achieve the same with If structure but it would be a lot messier
I'm personally saving audio codecs to custom field "Audio Formats (MediaInfo)" instead of compression as MC only shows first tracks codec and also because that "+atmos" disappears from compression field if you do update from tags
-
Thank you. If it isn't too much trouble, can you tell me how you saved the output from MediaInfo into a field, I'd appreciate it.
If not, that's OK. The IF logic you provided is working as I need it!
-
I'm using MCUtils but in SoT it would mean adding mapping to text box fron top to bottom:
Audio Languages (MediaInfo)
Format
Audio
You need to of course create "Audio Languages (MediaInfo)" field in MC.
Your above mapping to text expression will be then somewhat more complex as it needs to handle multiple audio types especially if you want to pretty print more codecs than your current expression does
-
Here's the final statement:
IfElse(
IsEqual([Compression],+atmos,8),
Dolby Atmos,
IsEqual([Compression],+dts:x,8),
DTS X,
IsEqual([Compression],truehd,8),
Dolby TrueHD,
IsEqual([Compression],dts-hd,8),
DTS-HD MA,
IsEqual([Compression],DTS,8),
DTS,
IsEqual([Compression],eac3,8),
Dolby Digital,
IsEqual([Compression],pcm,8),
Dolby Atmos,
IsEqual([Compression],ac3,8),
Dolby Digital,
IsEqual([Compression],aac,8),
Dolby Digital
)
Thanks for the SoT info and all of your help... it is working now!