我正在使用EC4 SP2 SDK在c#中編寫應用程序。編碼器SDK 4 - 推送到發佈點
我想將我的文件發佈到媒體服務器發佈點。我搜索了2個關於發佈點的驗證和認證的例子,但是它們都來自舊的sdk's或者不工作(並且用於控制檯)。基本上我的應用程序不編碼任何東西,就好像它沒有任何編碼。 當在消除模式checkpont我可以看到源文件和服務器的正確屬性。
編碼過程需要0secs來處理。我檢查了服務器事件上的日誌,並收到警告「安全系統已收到並且無法解碼的身份驗證請求」。我只是沒有什麼知識可以比這個更進一步。任何幫助,將不勝感激。
這是一段代碼:
private void broadcastSourceFileToMediaServer2()
{
using (LiveJob job = new LiveJob())
{
String filetoencode = @"c:\temp\niceday.wmv";
LiveFileSource filesource = job.AddFileSource(filetoencode);
filesource.PlaybackMode = FileSourcePlaybackMode.Loop;
job.ActivateSource(filesource);
job.ApplyPreset(LivePresets.VC1Broadband4x3);
//don't know which one is good to use
job.AcquireCredentials += new EventHandler<AcquireCredentialsEventArgs>(job_AcquireCredentials);
_myUserName = "indes";
_pw = PullPW("indes");
Uri url = new Uri("http://192.168.1.74:8080/live");
PushBroadcastPublishFormat pubpoint = new PushBroadcastPublishFormat();
pubpoint.PublishingPoint = url;
pubpoint.UserName = _myUserName;
pubpoint.Password = _pw;
job.PublishFormats.Add(pubpoint);
job.PreConnectPublishingPoint();
job.StartEncoding();
statusBox.Text = job.NumberOfEncodedSamples.ToString();
job.StopEncoding();
job.Dispose();
}
}
public static string _myUserName { get; set; }
public static SecureString _pw { get; set; }
//codificação de Password a enviar
private static SecureString PullPW(string pw)
{
SecureString s = new SecureString();
foreach (char c in pw) s.AppendChar(c);
return s;
}
static void job_AcquireCredentials(object sender, AcquireCredentialsEventArgs e)
{
e.UserName = _myUserName;
e.Password = _pw;
e.Modes = AcquireCredentialModes.None;
}