Hi Admin-Team,
I'm trying to grab specific values of the "%s_info_mediainfo%"-output.
But I'm not sure how to populate.
Specifically: which command would be necessary to get for example the value of "format_commercial" within the video-section of the json-output?
$jsonget('%s_info_mediainfo%', '[???].format_commercial').
If possible it would be great if someone could help me.
I would prefer to avoid using mediainfo in command executor to get the values because having already a built-in-option would simplify these specific workflows where I need it.
Taner
Mediainfo Variable | Retrieving Specific Values
Re: Mediainfo Variable | Retrieving Specific Values
Hi taner,
Yes I think this is doable but because we don't know what index the video has we need to pull some regex magic on the media info string.
So, create some variable like %s_my_variable% and the "Populate" node to set:
Line 1 -> %s_my_variable% to $regext("%s_info_mediainfo%", '(?s)"@type"\s*:\s*"Video".+"Format_Commercial"\s*:\s*"\w+"')
Line 2 -> %s_my_variable% to $jsonget("{%s_my_variable%}", "Format_Commercial")
This should give you what you're after.
-steinar
Yes I think this is doable but because we don't know what index the video has we need to pull some regex magic on the media info string.
So, create some variable like %s_my_variable% and the "Populate" node to set:
Line 1 -> %s_my_variable% to $regext("%s_info_mediainfo%", '(?s)"@type"\s*:\s*"Video".+"Format_Commercial"\s*:\s*"\w+"')
Line 2 -> %s_my_variable% to $jsonget("{%s_my_variable%}", "Format_Commercial")
This should give you what you're after.
-steinar
Re: Mediainfo Variable | Retrieving Specific Values
Great!
Many Thanks!
Many Thanks!
Re: Mediainfo Variable | Retrieving Specific Values
@taner
just on a sidenote, because i had a case reported just last week:
Please be aware that the mediainfo output for format_commercial is a "guess" from mediainfo, so in difference to e.g. some video height or such, it is not a value that comes from the media file but it was calculated by mediainfo.
So the value you face might be inaccurate in some cases, e.g. here some snipped from mediainfo source code for XDCAMHD:
The above check is very rough, e.g. RDD9 defines the GOP must be (N<=12, M<=3) but above only checks if N=1. Besides i am not sure if the Bitrate checks will always be fine after some XDCAM has been edited. Still the file would be really xdcam compatible but mediainfo would report that its not.
All that just means, you should be aware that the data you are checking for is a calculated value which is not guaranteed to be 100% correct.
just on a sidenote, because i had a case reported just last week:
Please be aware that the mediainfo output for format_commercial is a "guess" from mediainfo, so in difference to e.g. some video height or such, it is not a value that comes from the media file but it was calculated by mediainfo.
So the value you face might be inaccurate in some cases, e.g. here some snipped from mediainfo source code for XDCAMHD:
Code: Select all
else if (Retrieve(Stream_Video, 0, Video_Format)==__T("MPEG Video") &&
!Retrieve(Stream_Video, 0, Video_Format_Settings_GOP).empty() &&
Retrieve(Stream_Video, 0, Video_Format_Settings_GOP)!=__T("N=1") &&
Retrieve(Stream_Video, 0, Video_Colorimetry)==__T("4:2:2") &&
(Retrieve(Stream_Video, 0, Video_BitRate)==__T("50000000")
|| Retrieve(Stream_Video, 0, Video_BitRate_Nominal)==__T("50000000")
|| Retrieve(Stream_Video, 0, Video_BitRate_Maximum)==__T("50000000")))
{
Fill(Stream_General, 0, General_Format_Commercial_IfAny, "XDCAM HD422");
Fill(Stream_Video, 0, Video_Format_Commercial_IfAny, "XDCAM HD422");
}
All that just means, you should be aware that the data you are checking for is a calculated value which is not guaranteed to be 100% correct.
emcodem, wrapping since 2009 you got the rhyme?
Re: Mediainfo Variable | Retrieving Specific Values
@emcodem: thanks for the info!
Good to know.
Good to know.