2017-12-12 19 views
1

동영상 업로드 후 내가 원하는 것은 제작자 스튜디오에 추가 할 수있는 무료 오디오에서 동영상에 오디오를 추가하고 싶습니다. . 비디오를 편집하여 오디오 섹션으로 직접 이동할 수는 있지만 소프트웨어가 수행하기를 원합니다. 이 내 코드는 동영상을 YouTube에 업로드 지금 :YouTube 동영상 업로드 및 무료 라이브러리 (C#)의 오디오 추가

UserCredential credential; 
     using (var stream = new FileStream("client_id.json", FileMode.Open, FileAccess.Read)) 
     { 
      credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
       GoogleClientSecrets.Load(stream).Secrets, 
       // This OAuth 2.0 access scope allows an application to upload files to the 
       // authenticated user's YouTube channel, but doesn't allow other types of access. 
       new[] { YouTubeService.Scope.YoutubeUpload }, 
       "user", 
       CancellationToken.None 
      ); 
     } 

     var youtubeService = new YouTubeService(new BaseClientService.Initializer() 
     { 
      HttpClientInitializer = credential, 
      ApplicationName = Assembly.GetExecutingAssembly().GetName().Name 
     }); 

     var video = new Video(); 
     video.Snippet = new VideoSnippet(); 
     video.Snippet.Title = "title"; 
     video.Snippet.Description = "description"; 
     video.Snippet.Tags = new string[]{"tags"}; 
     video.Snippet.CategoryId = "22"; 
     video.Status = new VideoStatus(); 
     video.Status.PrivacyStatus = "public"; 
     var filePath = "video.avi" 

     using (var fileStream = new FileStream(filePath, FileMode.Open)) 
     { 
      var videosInsertRequest = youtubeService.Videos.Insert(video, "snippet,status", fileStream, "video/*"); 
      videosInsertRequest.ProgressChanged += videosInsertRequest_ProgressChanged; 
      videosInsertRequest.ResponseReceived += videosInsertRequest_ResponseReceived; 

      await videosInsertRequest.UploadAsync(); 
     } 

난 그냥 프로그램 제작자 스튜디오에서 업로드 된 유튜브에 오디오를 추가해야합니다. 도움을 주시면 감사하겠습니다.

답변