Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation support #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ The only required field for the metadata file is the srcVideo and the workflow w
"MediaConvert_Template_2160p":"string",
"MediaConvert_Template_1080p":"string",
"MediaConvert_Template_720p":"string",
"JobTemplate":"custom-job-template"
"JobTemplate":"custom-job-template",
"InputRotate": "DEGREE_0"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.aws.amazon.com/mediaconvert/latest/apireference/jobs.html#jobs-model-inputrotate

Should also probably mention using anything but default is going to cause the profiler to possibly select the wrong encoding profile as it's pixel math will be utilizing the pre-rotated dimensions.

For example, all ios videos record portrait (without the developer normalizing) videos with ROTATE 90, if AUTO were to be selected, without overriding the JobTemplate, the profiler doesn't know what the final dimensions after rotation may be.

If you know you have 16:9 portrait videos with ROTATION 90, you will need to intervene to help profiler out

if (event.srcWidth > event.srcHeight) {
      console.log('This video is most likely going to get rotated, swap width/height')
      event.srcWidth = mediaInfo.video[0].height;
      event.srcHeight = mediaInfo.video[0].width;
 }

}
```

Expand Down
3 changes: 2 additions & 1 deletion source/encode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ exports.handler = async (event) => {
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW"
"ColorSpace": "FOLLOW",
"Rotate": event.inputRotate
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
Expand Down
5 changes: 3 additions & 2 deletions source/encode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"scripts": {
"test": "mocha lib/*.spec.js"
},
"dependencies": {},
"dependencies": {
"aws-sdk": "^2.414.0"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new Rotate is a new VideoSelector key, and this will fail without using the latest version of MediaConvert

},
"devDependencies": {
"aws-sdk": "*",
"aws-sdk-mock": "*",
"chai": "*",
"mocha": "*",
Expand Down
1 change: 1 addition & 0 deletions source/input-validate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exports.handler = async (event) => {
startTime: moment().utc().format('YYYY-MM-DD HH:mm.S'),
workflowTrigger:event.workflowTrigger,
workflowStatus: 'Ingest',
inputRotate: 'DEGREE_0',
workflowName:process.env.WorkflowName,
srcBucket: process.env.Source,
destBucket: process.env.Destination,
Expand Down