From: vasary.daniel Date: Thu, 12 Nov 2020 14:43:11 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=1944c8299e3923a038338168dc75774189faf8b6;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32051 --- diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index e51b6464..dbce69ab 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -8,6 +8,7 @@ using MaestroShared.Metadata; using MaestroShared.Resources; using MaestroShared.Target; using MaestroShared.Targets; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Diagnostics; @@ -124,9 +125,13 @@ namespace Maestro { doc.Load(discMeta); string itemHouseId = null; + string discName = null; try { XmlNode node = doc.DocumentElement.GetElementsByTagName("UserDiscId")[0]; itemHouseId = node.Attributes["value"].Value; + node = doc.DocumentElement.GetElementsByTagName("MainTitle")[0]; + discName = node.Attributes["usAscii"].Value; + } catch { logger.Info("discmeta.xml doesn't contains UserDiscId, skipping auto process"); return; @@ -134,11 +139,11 @@ namespace Maestro { if (MsgBox.YesNoQuestion("Új betöltendő tartalmat deketáltam. Indulhat az automatikus betöltés?")) - BeginInvoke(new Action(() => AutoProcess(files, target, itemHouseId))); + BeginInvoke(new Action(() => AutoProcess(files, target, itemHouseId, discName))); } - private void AutoProcess(string[] files, Target target, string itemHouseId) { + private void AutoProcess(string[] files, Target target, string itemHouseId, string discName) { long count = files.Count() / 2; logger.Info($"Auto processing {count} items"); @@ -157,12 +162,15 @@ namespace Maestro { string proxy = file.Replace("\\Clip\\", "\\Sub\\"); proxy = proxy.Substring(0, proxy.LastIndexOf(".")) + "S01" + proxy.Substring(proxy.LastIndexOf(".")); + FileInfo proxyFi = new FileInfo(proxy); if (!proxyFi.Exists) { logger.Info($"Proxy {proxy} not exists, skipping {file}"); continue; } + logger.Info($"Using proxy {proxy}"); + TargetProcessorParameter processorParameter = null; try { //mxf metadata + duration @@ -172,6 +180,13 @@ namespace Maestro { metadata.mediaHouseId = metadata.mediaTitle; metadata.mediaTitle = sourceItem.FileInfo.Name; processorParameter = CreateProcessorParameter(target, sourceItem, metadata, DateTime.Now, null); + + + var serializedTargetConfig = JsonConvert.SerializeObject(processorParameter.TargetConfig); + Target targetConfig = JsonConvert.DeserializeObject(serializedTargetConfig); + targetConfig.OutputFormat = discName + "-" + targetConfig.OutputFormat; + + processorParameter.TargetConfig = targetConfig; processorParameter.ProxyPath = proxy; } catch (Exception e) { logger.Error(e.Message); diff --git a/client/Maestro/Properties/AssemblyInfo.cs b/client/Maestro/Properties/AssemblyInfo.cs index 0d9faa6e..8e656c19 100644 --- a/client/Maestro/Properties/AssemblyInfo.cs +++ b/client/Maestro/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.1.0")] -[assembly: AssemblyFileVersion("2.1.1.0")] +[assembly: AssemblyVersion("2.1.1.1")] +[assembly: AssemblyFileVersion("2.1.1.1")] diff --git a/client/Maestro/RestoreMedia.cs b/client/Maestro/RestoreMedia.cs index 45591277..18115a13 100644 --- a/client/Maestro/RestoreMedia.cs +++ b/client/Maestro/RestoreMedia.cs @@ -54,7 +54,7 @@ namespace Maestro { { "mediaCubeMedia", selectedMetadata.RedefineMedia.Serialize() } }; logger.Info("Submitting {0}", data.ToString()); - api.SubmitJob(mediaCubeMetadata.JobTemplate, data); + api.SubmitJob(mediaCubeMetadata.JobTemplate, "Visszatöltés", data); } private void RestoreMedia_FormClosing(object sender, FormClosingEventArgs e) { diff --git a/client/MaestroShared/Properties/AssemblyInfo.cs b/client/MaestroShared/Properties/AssemblyInfo.cs index 44a99e1f..6846506a 100644 --- a/client/MaestroShared/Properties/AssemblyInfo.cs +++ b/client/MaestroShared/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.6")] -[assembly: AssemblyFileVersion("2.1.0.6")] +[assembly: AssemblyVersion("2.1.0.7")] +[assembly: AssemblyFileVersion("2.1.0.7")] diff --git a/client/MaestroShared/Targets/FTPTargetProcessor.cs b/client/MaestroShared/Targets/FTPTargetProcessor.cs index a535c95d..b26e493b 100644 --- a/client/MaestroShared/Targets/FTPTargetProcessor.cs +++ b/client/MaestroShared/Targets/FTPTargetProcessor.cs @@ -109,6 +109,9 @@ namespace MaestroShared.Targets { } } + protected override void UploadProxy() { + throw new Exception("Proxy upload not supported in FTPTargetProcessor!"); + } protected override void UploadContent(string outputPath, byte[] content) { using (Stream ostream = targetFTP.OpenWrite(outputPath, FtpDataType.Binary, false)) { try { diff --git a/client/MaestroShared/Targets/UNCTargetProcessor.cs b/client/MaestroShared/Targets/UNCTargetProcessor.cs index 4e866041..459383bf 100644 --- a/client/MaestroShared/Targets/UNCTargetProcessor.cs +++ b/client/MaestroShared/Targets/UNCTargetProcessor.cs @@ -43,6 +43,7 @@ namespace MaestroShared.Targets { protected FileInfo inputFile; protected string workingDir; private string sourcePath; + private int CurrentFileVersion = 0; public WorkflowAction workFlowAction { get; set; } @@ -455,7 +456,15 @@ namespace MaestroShared.Targets { protected virtual void UploadProxy() { int pbCancel = 0; string outputPath = Path.GetDirectoryName(Output); - string outputFile = Path.GetFileName(Parameters.ProxyPath); + + string nameWithoutExtension = GetDynamicText(Parameters.TargetConfig.OutputFormat); + string extension = Path.GetExtension(Parameters.ProxyPath); + + if (CurrentFileVersion > 0) + nameWithoutExtension += "-" + CurrentFileVersion; + + string outputFile = nameWithoutExtension + "S01" + extension; + outputFile = outputFile.ToUpper(); string targetFilePath = Path.Combine(outputPath, STATUS_FOLDER, outputFile); EnsureDirectoryExistence(Path.GetDirectoryName(targetFilePath)); @@ -478,10 +487,12 @@ namespace MaestroShared.Targets { } private bool doCopy(ref int pbCancel, string sourceFilePath, string targetFilePath) { - return Win32File.CopyFileEx(Input, targetFilePath, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE); + logger.Info($"doCopy {sourceFilePath} -> {targetFilePath}"); + return Win32File.CopyFileEx(sourceFilePath, targetFilePath, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE); } private bool doAlternateCopy(string sourceFilePath, string targetFilePath) { + logger.Info($"doAlternateCopy {sourceFilePath} -> {targetFilePath}"); CustomFileCopier copier = new CustomFileCopier(sourceFilePath, targetFilePath); copier.OnProgressChanged += Copier_OnProgressChanged; copier.Copy(); @@ -527,12 +538,12 @@ namespace MaestroShared.Targets { extension = extension.ToUpper(); string result = string.Format(FILENAME, nameWithoutExtension, extension); if (!Parameters.TargetConfig.DisableFileVersioning) { - int version = 1; + logger.Info($"File versioning is enabled"); while (FileExists(GetOutputFilePath(workingDir, result))) { - string versioned = string.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension); + CurrentFileVersion++; + string versioned = string.Format(VERSIONED_FILENAME, nameWithoutExtension, CurrentFileVersion, extension); logger.Debug(ALREADY_EXISTS, result, versioned); result = versioned; - version++; } } logger.Trace(Strings.EXIT); diff --git a/server/-dependencies/libs/libhumblevideo-0.dll b/server/-dependencies/libs/libhumblevideo-0.dll new file mode 100644 index 00000000..c47fb08a Binary files /dev/null and b/server/-dependencies/libs/libhumblevideo-0.dll differ diff --git a/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java b/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java index 46e05f4b..2baef985 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java @@ -19,6 +19,8 @@ public class MediaInfo { private String colorSpace; private int audioStreams; private int videoStreams; + private int height; + private int width; public MediaInfo(Path filePath) { this.filePath = filePath; @@ -40,10 +42,18 @@ public class MediaInfo { return frames; } + public int getHeight() { + return height; + } + public int getVideoStreams() { return videoStreams; } + public int getWidth() { + return width; + } + public void process() throws InterruptedException, IOException { Demuxer demuxer = null; try { @@ -67,6 +77,10 @@ public class MediaInfo { if (frames == 0) frames = stream.getDuration(); colorSpace = decoder.getPixelFormat().toString(); + + height = decoder.getHeight(); + width = decoder.getWidth(); + } if (decoder.getCodecType() == MediaDescriptor.Type.MEDIA_AUDIO) { audioStreams++;