예제 #1
0
        private VideoInformation CreateVideoInformationK28JobNode(string FileName, string AssetID, string AssetLocatorPath)
        {
            VideoInformation videoinfo = new VideoInformation()
            {
                FileName = FileName
            };
            var EncodeFileName = System.Web.HttpUtility.UrlPathEncode(videoinfo.FileName);

            IActionsProvider xman = ActionProviderFactory.GetActionProvider();
            var assetStatus       = xman.GetAssetStatus(AssetID);

            if (assetStatus.State == ExecutionStatus.Finished)
            {
                videoinfo.MP4URL = "";
            }
            else
            {
                videoinfo.MP4URL = $"{AssetLocatorPath}{EncodeFileName}";
            }

            videoinfo.MMRKURL = GetBlobSasUri("mmrkrepo", $"{AssetID}/{EncodeFileName}.mmrk");

            //Update GOP, Bitrate and Video filter
            return(ParseGopBitrateFilter(videoinfo));
        }
예제 #2
0
        private VideoInformation CreateVideoInformationK28JobNode(string FileName, IAsset theAsset, string AssetLocatorPath)
        {
            VideoInformation videoinfo = new VideoInformation()
            {
                FileName = FileName
            };
            var EncodeFileName = System.Web.HttpUtility.UrlPathEncode(videoinfo.FileName);

            IActionsProvider xman = ActionProviderFactory.GetActionProvider();
            var assetStatus       = xman.GetAssetStatus(theAsset.Id);

            if (assetStatus.State == ExecutionStatus.Finished)
            {
                videoinfo.MP4URL = "";
            }
            else
            {
                if (!string.IsNullOrEmpty(AssetLocatorPath))
                {
                    //USE Streaming server URL
                    videoinfo.MP4URL = $"{AssetLocatorPath}{EncodeFileName}";
                }
                else
                {
                    var strConn = System.Configuration.ConfigurationManager.AppSettings[theAsset.StorageAccountName];

                    var account = CloudStorageAccount.Parse(strConn);
                    var client  = account.CreateCloudBlobClient();

                    //USES SAS URL
                    videoinfo.MP4URL = GetBlobSasUri(client, theAsset.Uri.Segments[1], EncodeFileName, SharedAccessBlobPermissions.Read, _SASTTL);
                }
            }
            SharedAccessBlobPermissions p =
                SharedAccessBlobPermissions.Read |
                SharedAccessBlobPermissions.Write |
                SharedAccessBlobPermissions.Add |
                SharedAccessBlobPermissions.Create;

            videoinfo.MMRKURL = GetBlobSasUri(_WaterMArkStorageBlobClient, "mmrkrepo", $"{theAsset.Id}/{EncodeFileName}.mmrk", p, _SASTTL);
            //Update GOP, Bitrate and Video filter
            return(ParseGopBitrateFilter(videoinfo));
        }
예제 #3
0
        private VideoInformation CreateVideoInformationK28JobNode(string FileName, IAsset theAsset, string AssetLocatorPath)
        {
            VideoInformation videoinfo = new VideoInformation()
            {
                FileName = FileName
            };
            var EncodeFileName = System.Web.HttpUtility.UrlPathEncode(videoinfo.FileName);

            IActionsProvider xman = ActionProviderFactory.GetActionProvider(_WaterMArkStorageAccount);
            var assetStatus       = xman.GetAssetStatus(theAsset.Id);

            if (assetStatus.State == ExecutionStatus.Finished)
            {
                //MMRK Files are Ready, not need to create it from original MP4 renditions
                videoinfo.MP4URL = "";
            }
            else
            {
                if (!string.IsNullOrEmpty(AssetLocatorPath))
                {
                    //USE Streaming server URL
                    videoinfo.MP4URL = $"{AssetLocatorPath}{EncodeFileName}";
                }
                else
                {
                    //USES SAS URL from AMS Storage, default or other.
                    //CloudBlobClient assetStorageClient = GetAssetBlobClient(theAsset);
                    CloudBlobClient assetStorageClient = GetAssetParentBlobClient(theAsset);
                    //Uses MP4 SAS URL AMS Storage
                    videoinfo.MP4URL = GetBlobSasUri(assetStorageClient, theAsset.Uri.Segments[1], EncodeFileName, SharedAccessBlobPermissions.Read, _SASTTL);
                }
            }
            SharedAccessBlobPermissions p =
                SharedAccessBlobPermissions.Read |
                SharedAccessBlobPermissions.Write |
                SharedAccessBlobPermissions.Add |
                SharedAccessBlobPermissions.Create;

            videoinfo.MMRKURL = GetBlobSasUri(_WaterMArkStorageBlobClient, "mmrkrepo", $"{theAsset.Id}/{EncodeFileName}.mmrk", p, _SASTTL);
            //Update GOP, Bitrate and Video filter
            return(ParseGopBitrateFilter(videoinfo));
        }