private string GetVideoRuntime() { if (!IsUpdate) { var retry = 1; var duration = string.Empty; while (retry < 5) { try { duration = VideoFileProperties.GetMediaInfoDuration(FullAssetName, IsUpdate); if (!string.IsNullOrEmpty(duration)) { break; } } catch (AccessViolationException sysException) { log.Error($"[GetVideoRuntime] AccessViolationException: {sysException.Message}"); if (sysException.InnerException != null) { log.Error($"[GetVideoRuntime] AccessViolationException Inner exception: {sysException.InnerException.Message}"); } } catch (Exception gvrException) { log.Error($"[GetVideoRuntime] General Exception: {gvrException.Message}"); if (gvrException.InnerException != null) { log.Error($"[GetVideoRuntime] General Inner exception: {gvrException.InnerException.Message}"); } } log.Info($"Get video duration experienced an error, retry attempt: {++retry}"); Thread.Sleep(3000); } return(duration); } return(AdiMapping.ADI_FILE.Asset.Metadata .App_Data .FirstOrDefault(r => r.Name == "Run_Time") ?.Value); }