[BUG] azure media services - crop issue
See original GitHub issueI believe there is a bug with the encoder in azure media services.
this is my encoding code in C#
var aacAudio = new AacAudio(channels: 2, samplingRate: 48000, bitrate: 128000,
profile: AacAudioProfile.AacLc);
rectangle = new Rectangle("656", "0", "1079", "607");
var hd3600Kbps = new H264Layer(bitrate: 3600000, height:"640", width:"360");
var h264Video = new H264Video(keyFrameInterval: TimeSpan.FromSeconds(2),
layers: new[] {hd3600Kbps});
var pngLayer = new PngLayer("50%", "50%");
var pngImage = new PngImage("25%", step: "25%", range: "80%", layers: new[] {pngLayer});
var codecs = new Codec[] {aacAudio, h264Video, pngImage};
var mp4Format = new Mp4Format("Video.{Basename}.{Label}.{Bitrate}{Extension}");
var pngFormat = new PngFormat("Thumbnail-{Basename}-{Index}{Extension}");
var formats = new Format[] {mp4Format, pngFormat};
var filters = rectangle == null ? null : new Filters {Crop = rectangle};
var standardEncoderPreset = new StandardEncoderPreset(codecs, formats, filters);
var outputs = new TransformOutput[]
{new(standardEncoderPreset, OnErrorType.StopProcessingJob, Priority.Normal)};
await client.Transforms.CreateOrUpdateAsync(_azureMediaOption.ResourceGroup,
_azureMediaOption.AccountName,
transformName,
outputs,
cancellationToken: cancellationToken);
I am cropping the video with this info:
{Left: 656, Top: 0, Height: 1079, Width: 607}
The video I have is 1920x1080 using the C# code above, the video needs to get cropped and encoded.
azure media services gives me an output but the output video is not cropped properly.
if I manually change the bit rate of the video on my computer and then encode it again this time it will work. I uploaded both videos as attachments to this issue.
this one is the problematic video, the video that dose not encode based on the code https://user-images.githubusercontent.com/14353301/127079656-667419c0-2de2-45f6-850a-da03041e8e86.mp4
here is the exact same video but with different bit rate and it gets encoded based on the job input
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Thanks for the feedback @dehghanfar, I’m sorry to hear that you moved to AWS. Our team will continue investigating this issue. In the meantime, it seems that you have found your own solution, so @jsquire can we close this issue?
Thank you for your feedback. Tagging and routing to the team best able to assist.