Search code examples
c#azureazure-media-services

Azure Media Services Sound


I have used azure media services to upload videos in C#, all this works, but it would seem that my videos that have been encoded don't have any sound, why would this be?

I would think it would be part of the encoding as below?

            // Prepare a job with a single task to transcode the specified asset
            // into a multi-bitrate asset.

            IJob job = _context.Jobs.CreateWithSingleTask(
                "Media Encoder Standard",
                "Adaptive Streaming",
                asset,
                asset.Name + " Adaptive Bitrate MP4",
                AssetCreationOptions.None);

            Console.WriteLine("Submitting transcoding job...");

            // Submit the job and wait until it is completed.
            job.Submit();

            job = job.StartExecutionProgressTask(
                j =>
                {
                    Console.WriteLine("Job state: {0}", j.State);
                    Console.WriteLine("Job progress: {0:0.##}%", j.GetOverallProgress());
                },
                CancellationToken.None).Result;

            Console.WriteLine("Transcoding job finished.");

            IAsset outputAsset = job.OutputMediaAssets[0];

            return outputAsset;

Solution

  • It sounds like you're wanting to do progressive download of your video assets. The 'Adaptive Streaming' encoding profile is primarily for video content that is going to be streamed. According to https://learn.microsoft.com/en-us/azure/media-services/previous/media-services-autogen-bitrate-ladder-with-mes you should use the 'Content Adaptive Multiple Bitrate MP4' encoding profile so that it includes audio in all of the MP4s. The 'Adaptive Streaming' profile only includes audio in the lowest bitrate video since including audio in every MP4 is unnecessary when streaming since you don't access the MP4 files directly but instead of a streaming protocol.