EE4 SDK:在编码媒体的末尾添加其他剪辑 [英] EE4 SDK: Adding an additional clip at the end of the encoded media

查看:61
本文介绍了EE4 SDK:在编码媒体的末尾添加其他剪辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我找不到任何有关如何在编码媒体末尾添加其他剪辑的示例。我可以在使用主GUI应用程序时没有任何问题。但遗憾的是我不知道如何将所有这些命令放在C#中

I couldn't find any example of how to add an additional clip to the end of the encoded media. I can do it without any issues on using the main GUI application. But unfortunately I don't know how to put all those command together in the C#

假设我们有以下代码转换文件。您可以通过插入必要的修改来为我更改它,这些修改将允许在转换过程中将附加文件附加到原始文件。
最后,我希望有一个转换后的文件,它将包含两个连接在一起的原始文件。  我可以在GUI中使用"剪辑"标签 提供(可以选择在附后添加其他文件)

Let say we have the following piece of code that is converting a file. Could you please alter it for me, by inserting the necessaries modifications that will allow to append an additional file to the original one during the converting procedures. At the end I want to have one converted file that will contain both original files joined together.  I can do it in GUI by using the 'Clip' tab proprieties (there is an option to append an additional file to the end)


    private static void LoadMedia(string MediaFile, string PresetName, string Destination)
    {
      MediaItem mItem;
      try
      {
        mItem = new MediaItem(MediaFile);
      }
      catch (InvalidMediaFileException)
      {
        Console.WriteLine("Error: Invalid Media File or Path");
        return;
      }

      Job job = new Job();
      job.MediaItems.Add(mItem);

      Encode(job, PresetName, Destination);
    }



    private static void Encode(Job job, string PresetName, string Destination)
    {
      // Sets the destination if defined and uses a default if not
      if (Destination != null)
        job.OutputDirectory = Destination;
      else
        job.OutputDirectory = @"c:\output";

      // Set up the progress callback function
      job.EncodeProgress += new EventHandler<EncodeProgressEventArgs>(OnProgress);

      //Sets preset if it was set and encodes job
      try
      {
        if (PresetName != null)
          job.ApplyPreset(Preset.FindPreset(PresetName));

        job.Encode();
      }
      catch (EncodeErrorException exp)
      {
        Console.WriteLine("Encoding Error: " + exp.ToString());
        return;
      }
      catch (PresetNotFoundException exp)
      {
        Console.WriteLine("Invalid Preset: " + exp.ToString());
        return;
      }
    }

推荐答案

应用程序附带的MergeMedia示例(SDK / Samples / MergeMedia)具有您所寻求的功能。
The MergeMedia sample that ships with the application (SDK/Samples/MergeMedia) has the functionality you seek.


这篇关于EE4 SDK:在编码媒体的末尾添加其他剪辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆