【发布时间】:2016-02-18 05:13:10
【问题描述】:
我正在尝试关注这篇文章:https://azure.microsoft.com/en-us/documentation/articles/media-services-custom-mes-presets-with-dotnet/#overlay。
每次我运行作业时,响应都是:错误:瞬态系统:发生了瞬态错误。我们对不便表示抱歉。请再试一次。
这是我的自定义预设(我还在此回复的末尾添加了 Sources 元素:https://stackoverflow.com/a/34094014/5940469):
{
"Version": 1.0,
"Codecs": [
{
"KeyFrameInterval": "00:00:03",
"SceneChangeDetection": true,
"H264Layers": [
{
"Profile": "High",
"Level": "4",
"Bitrate": 8500,
"MaxBitrate": 8500,
"BufferWindow": "00:00:05",
"Width": 1920,
"Height": 1080,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
}
],
"Type": "H264Video"
},
{
"Profile": "AACLC",
"Channels": 2,
"SamplingRate": 48000,
"Bitrate": 192,
"Type": "AACAudio"
}
],
"Outputs": [
{
"FileName": "{Basename}_hi.mp4",
"Format": {
"Type": "MP4Format"
}
}
],
"Sources": [
{
"Streams": [ ],
"Filters": {
"VideoOverlay": {
"Position": {
"X": 100,
"Y": 100,
"Width": 100,
"Height": 106
},
"AudioGainLevel": 0.0,
"MediaParams": [
{
"OverlayLoopCount": 1
},
{
"IsOverlay": true,
"OverlayLoopCount": 1,
"InputLoop": true
}
],
"Source": "logo.jpg",
"Clip": {
"Duration": "00:00:05"
},
"FadeInDuration": {
"Duration": "00:00:01"
},
"FadeOutDuration": {
"StartTime": "00:00:03",
"Duration": "00:00:04"
}
}
},
"Pad": true
}
]
}
如果没有 Sources 元素,作业会正确完成。
这是我用来创建作业的代码:
var job = context.Jobs.Create("New Job");
var processor = find the processor that has name "Media Encoder Standard"...
var preset = readtextfromjson...
var task = job.Tasks.AddNew("Video with overlay", processor, preset, TaskOptions.None);
task.InputAssets.Add(videoAsset);
task.InputAssets.Add(logoAsset);
task.OutputAssets.AddNew("Output files", AssetCreationOptions.None);
await job.SubmitAsync();
await job.GetExecutionProgressTask(cancellationToken);
logoAsset 有一个名为“logo.jpg”的assetFile。
【问题讨论】:
标签: azure encoding azure-media-services