Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS elemental media convert auto rotating video?

I'm converting an mp4 video to HLS using AWS elemental media convert. Everything works well but the output video is rotated by 90 degrees. Is there a setting that I can use to stop this from happening. I'm shooting the video on an iPhone.

like image 883
Aravind Avatar asked Aug 04 '18 05:08

Aravind


3 Answers

AWS Elemental Media Convert has now added support for rotation.

like image 77
Aravind Avatar answered Oct 21 '22 03:10

Aravind


Under Inputs->Video Selector, You will find an option called Rotate (clockwise)(InputRotate) to specify how to rotate your video. You can choose automatic rotation or specify a rotation. You can specify a clockwise rotation of 0, 90, 180, or 270 degrees.

If your input video container is .mov or .mp4 and your input has rotation metadata, you can choose Automatic to have the service rotate your video according to the rotation specified in the metadata. The rotation must be within one degree of 90, 180, or 270 degrees. If the rotation metadata specifies any other rotation, the service will default to no rotation. Use Rotate (InputRotate) to specify how the service rotates your video. You can choose automatic rotation or specify a rotation. You can specify a clockwise rotation of 0, 90, 180, or 270 degrees.

By default, media convert does no rotation, even if your input video has rotation metadata. The service doesn't pass through rotation metadata.

like image 24
Naveen S Avatar answered Oct 21 '22 01:10

Naveen S


Per an AWS blog post (https://aws.amazon.com/blogs/media/how-to-migrate-workflows-from-amazon-elastic-transcoder-to-aws-elemental-mediaconvert/), auto-rotation is not supported.

I can't find an option for a Manual Rotation either, but that may exist without my knowledge.

Why should you stay on Amazon Elastic Transcoder?

For the small set of features listed below, you still need to use Amazon Elastic Transcoder.

These features are:

  • WebM (VP8/VP9) input and output
  • Animated GIF output
  • MP4 auto-rotation flag support
  • MP3, FLAC, Vorbis, and WAV audio-only output
  • Encryption support using KMS integration

Where is the Rotation Information?

Video files have embedded metadata in them that can be extracted. I've used MediaInfo (https://mediaarea.net/en/MediaInfo), ffprobe I think does the same thing as well (https://ffmpeg.org/ffprobe.html).

The file metadata has plenty of information, one of which is the "Rotation" details. ("Rotation": "90.000",). I assume ElasticTranscoder automatically utilizes this to put your file in the right orientation.

I'd like to see MediaConvert, at the very least, have this option as an input parameter. That way we could pass it in to the job call. It requires the step of pulling this metadata, but at least the option would be there.

like image 20
Mike S. Avatar answered Oct 21 '22 02:10

Mike S.