IP カメラからビデオを取得し、YouTube チャンネルにライブで送信する WPF アプリケーションを作成したいと考えています。私はすべての Web サイトを見回していますが、C# を使用して YouTube にビデオをライブ ストリーミングする方法の例はありません。Google のウェブサイトに例がありますが、PHP、Java、および Phyton で記述されていますが、このプログラミング言語を知らないため、API を使用できませんでした。
少し書いてみましたがうまくいきませんでした。Javaの例を見て書いた私のコードは次のとおりです。
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets { ClientId = "MyClientId", ClientSecret = "MyClientSecret" },
new[] { DriveService.Scope.Drive,
DriveService.Scope.DriveFile },
"My Youtube Channel Name",
CancellationToken.None,
new FileDataStore("Drive.Auth.Store")).Result;
string devkey = "AIzaSyCbxm6g9orAw9PF3MkzTb_0PGbpD3Xo1Qg";
string username = "MyYoutubeChannelEmailAdress";
string password = "MyPassword";
YouTubeRequestSettings youtubereqsetting = new YouTubeRequestSettings("API Project", devkey, username, password);
YouTubeRequest youtubereq = new YouTubeRequest(youtubereqsetting);
LiveBroadcastSnippet broadcastSnippet = new LiveBroadcastSnippet();
broadcastSnippet.Title = "Test Live Stream";
broadcastSnippet.ScheduledStartTime = new DateTime(2015, 3, 12, 19, 00, 00);
broadcastSnippet.ScheduledEndTime = new DateTime(2015, 3, 12, 20, 00, 00);
LiveBroadcastStatus status = new LiveBroadcastStatus();
status.PrivacyStatus = "Private";
LiveBroadcast broadcast = new LiveBroadcast();
broadcast.Kind = "youtube#liveBroadcast";
broadcast.Snippet = broadcastSnippet;
broadcast.Status = status;
Google.Apis.YouTube.v3.LiveBroadcastsResource.InsertRequest liveBroadcastInsert = new Google.Apis.YouTube.v3.LiveBroadcastsResource.InsertRequest(service, broadcast, "");
LiveBroadcast returnLiveBroadcast = liveBroadcastInsert.Execute();
私を助けてください!?!?!?