01-26-2015 01:14 PM
public class Analysis {
public void MediaInfoAction(DelegateExecution execution, String Nickname)
{
EssenceMediaInfo MediaInfo = new EssenceMediaInfo();
HashMap<String, String> NicknameDetails = MediaInfo.ParseNicknameProperties(execution, Nickname);
String JsonString = "{"
+ "\"GeneralVideoCount\" : \"%VideoCount%\", "
+ "\"GeneralAudioCount\" : \"%AudioCount%\", "
+ "\"GeneralCompleteName\" : \"%CompleteName%\", "
+ "\"GeneralFormat\" : \"%Format%\", "
+ "\"GeneralFormatCommercial\" : \"%Format_Commercial%\", "
+ "\"GeneralFormatProfile\" : \"%Format_Profile%\", "
+ "\"GeneralFormatSettings\" : \"%Format_Settings%\", "
+ "\"GeneralFileExtension\" : \"%FileExtension%\", "
+ "\"GeneralFileSize\" : \"%FileSize%\", "
+ "\"GeneralOverallBitRateMode\" : \"%OverallBitRate_Mode%\", "
+ "\"GeneralOverallBitRateBps\" : \"%OverallBitRate%\", "
+ "\"GeneralOverallBitRateMbps\" : \"%OverallBitRate/String%\", "
+ "\"DidMediaInfoGeneralAnalysis\" : \"true\"}";
JsonString = MediaInfo.GetFilePropertyByJson("General", JsonString);
SetVariables(execution, JsonString);
}
public void SetVariables(DelegateExecution execution, String JsonString) throws ParseException
{
ContainerFactory containerFactory = new ContainerFactory()
{
public List creatArrayContainer() {
return new LinkedList();
}
public Map createObjectContainer() {
return new LinkedHashMap();
}
};
Map json = (Map) this.JsonParser.parse(JsonString, containerFactory);
Iterator iter = json.entrySet().iterator();
while(iter.hasNext())
{
Map.Entry entry = (Map.Entry)iter.next();
execution.setVariable(entry.getKey().toString(), entry.getValue().toString());
}
}
}
01-29-2015 03:01 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.