0

我正在使用 Microsoft Expression Encoder,这是我的代码

using (LiveJob job = new LiveJob())
        {
            // Creates file source for encoding
            LiveFileSource fileSource = job.AddFileSource(DataDirectory);

            // Sets playback to loop on reaching the end of the file
            fileSource.PlaybackMode = FileSourcePlaybackMode.Jump;


            // Sets this source as the current active one
            job.ActivateSource(fileSource);

            job.ApplyPreset(LivePresets.VC1IISSmoothStreamingLowBandwidthStandard);


            PushBroadcastPublishFormat format = new PushBroadcastPublishFormat();
            format.PublishingPoint = new Uri(PublishPoint);
            job.PublishFormats.Add(format);

            // Starts encoding
            job.StartEncoding();
   }

这段代码在他完成一个目录时对目录中的文件列表进行编码他跳到下一个我想要做的是在传递给另一个文件之前在编码时更改文件名

4

1 回答 1

2

我已经添加了这个方法我不知道它是否有效

public void liveJob_Status(object sender, EncodeStatusEventArgs e)
    {
        if (e.Status == EncodeStatus.Jumped)
        { LiveFileSource file = (LiveFileSource)e.LiveSource; 
          string name = file.Name;
          string modified_name = "Encode" + name;

          File.Move(DataDirectory + @"\" + name, DataDirectory + @"\" + name.Replace(name, modified_name)); 
        }
    }
于 2013-04-19T09:00:58.353 回答