我正在尝试在使用Media Encoder Standard用Azure Media Service编码的视频上覆盖循环播放的音频轨道。经过广泛的搜索后,我无法找到任何有关如何完成此操作的指南/文档,即使它得到了官方支持也是如此。看这里:https://docs.microsoft.com/en-us/azure/media-services/previous/media-services-advanced-encoding-with-mes#overlay似乎表明在给定AudioGainLevel和Looping配置的情况下是可能的。我试图将mp3资产上传到为mp4视频创建的AMS资产(audio_overlay.mp3),类似于它们对图像叠加层的建议。然后,我在预设配置中引用了该mp3。这是黑暗中的完整镜头,编码工作使它达到90%,然后失败,并显示“发生错误。阶段:ApplyEncodeCommand”。
这可能吗?如果可能,怎么办?
预设Json配置以供参考,当然,在此用例中,位置配置是不相关的(我尝试使用和不使用):
{
"Version": 1.0,
"Sources": [
{
"Streams": [],
"Filters": {
"AudioOverlay": {
"Position": {
"X": 100,
"Y": 100,
"Width": 1,
"Height": 1
},
"AudioGainLevel": 1.0,
"MediaParams": [
{
"OverlayLoopCount": 1
},
{
"IsOverlay": true,
"OverlayLoopCount": 1,
"InputLoop": true
}
],
"Source": "audio_overlay.mp3",
"Clip": {
"Duration": "00:00:05"
},
"FadeInDuration": {
"Duration": "00:00:01"
},
"FadeOutDuration": {
"StartTime": "00:00:03",
"Duration": "00:00:04"
}
}
},
"Pad": true
}
],
"Codecs": [
{
"KeyFrameInterval": "00:00:02",
"H264Layers": [
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 1300,
"MaxBitrate": 1300,
"BufferWindow": "00:00:05",
"Width": 848,
"Height": 480,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
},
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 650,
"MaxBitrate": 650,
"BufferWindow": "00:00:05",
"Width": 640,
"Height": 360,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
},
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 400,
"MaxBitrate": 400,
"BufferWindow": "00:00:05",
"Width": 432,
"Height": 240,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
}
],
"Type": "H264Video"
},
{
"Profile": "AACLC",
"Channels": 2,
"SamplingRate": 48000,
"Bitrate": 128,
"Type": "AACAudio"
}
],
"Outputs": [
{
"FileName": "{Basename}_{Width}x{Height}_{VideoBitrate}.mp4",
"Format": {
"Type": "MP4Format"
}
}
]
}