1
votes

Problem summarized

We're using Azure Media Services v3 for streaming media files with Azure Media Player. Currently I'm trying to add an option to stream .mp3 with AES encryption. Uploading and encoding the file works fine, I can see the generated .mp4 file and I can even play it if I download it from the blob. The problem is when I try to stream it in Azure Media Player I get the following error in the player: image This is because Azure Media Player doesn't support streaming audio only files as it is stated in its documentation:

May work in some techs for Adaptive Streaming but is currently not supported and does not work in AzureHtml5JS.

What I've tried

So I've tried to add blank/empty h264Layer to the transform job so the encoded file wouldn't be audio-only. I've found some questions regarding this problem, like this, however my problem is still unresolved. I've also found this suggestion, which led me to Azure Media Services v2 documentation page but I think it isn't what I need. I've also seen this note:

Many of the advanced Media Services v2 features of the Media Encoder Standard are currently not available in v3. For more information, see feature gaps.

I set the encoding preset to "EncoderNamedPreset.AACGoodQualityAudio". Then to "EncoderNamedPreset.H264SingleBitrate720p" just to see if it creates an empty video layer but the result was the same: the video file was created in its own asset but I wasn't able to stream it.

I've tried to create my own encoder preset with empty H264Layer like this:

new StandardEncoderPreset(
    codecs: new Codec[]
    {
        new AacAudio(
            channels: 2,
            samplingRate: 48000,
            bitrate: 128000,
            profile: AacAudioProfile.AacLc
            ),
        new H264Video(
            keyFrameInterval: TimeSpan.FromSeconds(2),
            sceneChangeDetection: true,
            layers: new H264Layer[]
            {
                new H264Layer (
                    bitrate: 1, // Units are in bits per second
                    width: "1",
                    height: "1",
                    label: "SD" // This label is used to modify the file name in the output formats
                )                            }
            )
    },
    formats: new Format[]
    {
        new Mp4Format(filenamePattern:"Video-{Basename}-{Label}-{Bitrate}{Extension}")
    }
)

Result while creating Transform:

Exception: Operation returned an invalid status code 'BadRequest'

With blank layer

new H264Layer (
    bitrate: 0, // Units are in bits per second
    width: "0",
    height: "0",
    label: "SD" // This label is used to modify the file name in the output formats
)  

Result while creating transform:

Exception: Operation returned an invalid status code 'BadRequest'

H264Layer without constructor parameters

new H264Layer()

Result: Transform is created. Same error in AMP when trying to stream it.

The video playback was aborted due to a corruption problem or because the video used features your browser did not support. (0x20400003)

Expected result

The expected result would be any kind of file what could be streamed by Azure Media Player. I guess this should be achieved somehow adding a blank/empty H264 layer to the encoded file but I can't figure out how to do it in Azure Media Services v3.

1

1 Answers

1
votes

Adding the response, that was conveyed offline, to this post:

  1. You are correct, that Azure Media Player currently requires a video track
  2. When using v2 APIs, there is a way to insert a video track when encoding an audio-only source
  3. That flag is currently not exposed in our v3 schema

However, should be able to use a v3 Preset like AdaptiveStreaming – it encodes the audio, and generates a ‘blank video’ track

Thanks,

Anil