C# 表达式编码器:编码后更改文件名
我正在使用Microsoft Expression Encoder,这是我的代码C# 表达式编码器:编码后更改文件名,c#,expression-encoder,expression-encoder-sdk,expression-encoder-4,C#,Expression Encoder,Expression Encoder Sdk,Expression Encoder 4,我正在使用Microsoft Expression Encoder,这是我的代码 using (LiveJob job = new LiveJob()) { // Creates file source for encoding LiveFileSource fileSource = job.AddFileSource(DataDirectory); // Sets playback to loop on
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();
}
这段代码对目录中的文件列表进行编码,当他完成一个目录时,他会跳到下一个目录
我想做的是在传递到另一个文件之前更改编码后的文件名我添加了这个方法,我不知道它是否有效
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));
}
}