0

미디어 서비스는 스트림에서 업로드하지 못하게하고 가상 폴더를 만들지 않으므로 이미지 및 비디오를 가상 폴더로 구성된 BLOB 컨테이너에 업로드하기로 결정했습니다.자산을 가상 폴더에 복사하는 방법

다음으로 하늘색 미디어 서비스의 이미지와 비디오를 처리해야합니다.

따라서 우리는 푸른 미디어 서비스에 애셋으로 애스펙트로 복사 한 다음 얼굴 변환자를 사용해야하며 애셋 형태의 결과를 각각의 가상 폴더에 업로드해야합니다.

문제는 Azure 미디어 서비스가 특정 가상 경로가있는 다른 컨테이너에 자산을 직접 업로드 할 수 없기 때문에 문제라고 생각합니다.

이 상황에 어떻게 접근합니까?

답변

0

우리의 닷넷 SDK는 스트림에서 업로드 할 몇 가지 방법을 제공한다 (this 페이지 하단 마지막 UploadAsync 과부하를 참조).

자산의 가상 디렉터리 구조는 지원하지 않습니다. Bruce Chen이 응답 한대로 Azure Storage API를 사용하여 가상 폴더가있는 BLOB 컨테이너와 Azure Media Services 자산이있는 BLOB 컨테이너간에왔다 갔다 할 수 있습니다.

+0

asp .net 코어를 사용하고 있습니다. 방금 ​​sdk가 asp .net 코어와 호환되지 않는 문제를 발견했습니다. 나는 face redactor를 위해 미디어 서비스 나머지 API를 사용하려고했지만 찾을 수 없었다. 그것은 존재하지 않기 때문입니까? 아니면 찾지 못했습니까? – Puzzle

+0

아직 .NET Core API가 없습니다. REST API를 사용해야합니다. – johndeu

0

AFAIK, 특정 저작물의 저작물 파일은 루트 폴더 아래에만있을 수 있습니다. 자산 파일을 다른 blob 컨테이너 아래의 다른 가상 폴더로 복사하려면 먼저 MediaServices SDK를 사용하여 자산을 검색 한 다음 저장소 클라이언트 SDK를 사용하여 자산 파일을 검색하고 원하는대로 복사 할 수 있다고 가정했습니다 다른 blob 컨테이너 아래의 대상. 여기에 코드, 당신은 그것을 참조 수 :

//retrieve the asset with the specific Id 
var asset = _context.Assets.Where(s => s.Id == "nb:cid:UUID:39a13eaf-48cf-4c3c-80d6-bcd6b3b7c8b4").FirstOrDefault(); 

//retrieve the container name for the current asset 
string assetContainerName = asset.Uri.Segments[1]; 

//construct the CloudBlobClient instance 
StorageCredentials mediaServicesStorageCredentials = new StorageCredentials("{storage-name}", "storage-key"); 
var storageAccount = new CloudStorageAccount(mediaServicesStorageCredentials, true); 
var mediaServiceBlobClient = storageAccount.CreateCloudBlobClient(); 

//construct the CloudBlobContainer instance for the current asset container 
var assetContainer = mediaServiceBlobClient.GetContainerReference(assetContainerName); 

//define the destination directory under another container 
var destDirectory = mediaServiceBlobClient.GetContainerReference("images").GetDirectoryReference("2017/11/7"); 

//copy the asset files under the current asset container to the specific virtual folder under another blob container 
foreach (CloudBlockBlob assetBlob in assetContainer.ListBlobs()) 
{ 
    var targetBlob = destDirectory.GetBlockBlobReference(assetBlob.Name); 
    targetBlob.StartCopy(assetBlob); 
} 
+0

가. 난 그냥 미디어 서비스 SDK는 ASP를 그물 코어와 호환되지 않는 문제를 건너 왔어요. 나는 얼굴 편집자에 대한 나머지 API를 미디어 서비스를 사용하려고 , 그러나 내가 얼굴 redactor에 대한 API를 찾을 수 없습니다. 그것은 존재하지 않기 때문에 아니면 그냥 찾았 어? – Puzzle

+0

. NET 코어에서 얼굴 Redactor를 사용하려면 언급 한대로 REST API를 래핑해야 할 것입니다.이 주석의 바깥쪽에 코드를 붙여 넣습니다. – johndeu

0

.NET 코어에서 FaceRedactor를 사용하려면 REST API를 사용하여 올바른 미디어 프로세서 ID 및 구성 설정으로 작업 만들기를 직접 수행하십시오.

https://docs.microsoft.com/en-us/azure/media-services/media-services-face-redaction

컬 -X POST \ https://tvmewest.restv2.westcentralus-2.media.azure.net/api/Jobs -H \ '동의 : 응용 프로그램/JSON을, 하나로, OData = 자세한'\ -H '인증 : 무기명 여기 당신의 AAD JWT BEARER 토큰 -H \ -H 'maxdataserviceversion : 3.0'\ -H '포스트 마스터 (cache-control : no-cache)'\ -H '콘텐츠 유형 : application/json; odata = 자세한 정보'\ -H 'dataserviceversion : 3.0' -token : 6662e359-cb76-d849-11c5-99da0514cdc1 '\ -H'user-agent : azure med 아이오와 서비스 우편 배달부 수집 '\ -H'의 X-MS-버전 : 2.15 '\ -d'{ "이름": "편집 테스트 작업" "InputMediaAssets": [{ "__metadata": { " URI ""https://tvmewest.restv2.westcentralus-2.media.azure.net/api//Assets ('\'NB : CID : UUID : 733f8d88-f96b-496c-a46e-38c037b89d48 '\' ') " } }] "작업 ": [{ "구성 ":" { '\' '버전'\ '': '\' '1.'' '' '' '' '' '' '' '' '블러 타입' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '높은'\ ''}} ", "MediaProcessorId ":"주의 : MPID : UUID : 3806d7a6-4985-4437-b098-50e3733310e8 TaskBody " ", ":" JobInputAsset (0) JobOutputAsset (0) 는 " 은}] } '내가 ASP를 그물 코어를 사용하고

+0

우편 배달부 컬렉션을 함께 사용하려면 [email protected]으로 전자 메일을 보내주십시오. 코드 샘플을 쉽게 생성 할 수 있습니다. – johndeu