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

MediaConvert - Rotate option "Auto" does not work #3692

Closed
1 task
MondQ opened this issue Mar 6, 2025 · 3 comments
Closed
1 task

MediaConvert - Rotate option "Auto" does not work #3692

MondQ opened this issue Mar 6, 2025 · 3 comments
Assignees
Labels
bug This issue is a bug. module/sdk-generated p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@MondQ
Copy link

MondQ commented Mar 6, 2025

Describe the bug

When supplying the rotate option auto using the .NET SDK no rotation is applied. If I use the AWS console to process the same file and specify the "Auto" rotation option my video is in the correct orientation.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

My portrait video is still in portrait orientation after conversion with MediaConvert.

Current Behavior

My portrait video is sideways after conversion.

Reproduction Steps

Specify the Rotate property on the VideoSelector class as InputRotate.AUTO.

Input input = new Input
{
    FileInput = s3InputFilePath,
    VideoSelector = new VideoSelector()
    {
        Rotate = InputRotate.AUTO
    }
};

Possible Solution

No response

Additional Information/Context

When I go to the console and check the JSON of the job that was triggered via the SDK the 'Rotate' property is not listed.

AWS .NET SDK and/or Package version used

AWSSDK.MediaConvert 3.7.409.3

Targeted .NET Platform

.NET 8

Operating System and version

Linux - Fedora Workstation 41

@MondQ MondQ added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 6, 2025
@ashishdhingra ashishdhingra self-assigned this Mar 6, 2025
@ashishdhingra ashishdhingra added needs-reproduction This issue needs reproduction. module/sdk-generated p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Mar 6, 2025
@ashishdhingra
Copy link
Contributor

Per VideoSelectorMarshaller, rotate property is set if the request field is not null. AWSSDK.MediaConvert package is auto-generated from service models and simply translates user's request to invoke a service API operation. So as such, this doesn't appear to be AWS .NET SDK issue.

Using example at Use CreateJob with an AWS SDK or CLI (code repository) and setting Rotate as InputRotate.AUTO at:

...
input.VideoSelector = new VideoSelector
{
    ColorSpace = ColorSpace.FOLLOW,
    Rotate = InputRotate.AUTO
};
...

marshalls request into below JSON:

{
    "clientRequestToken": "c0a591e6-7055-4a22-9626-a214ae08112f",
    "role": "arn:aws:iam::<<ACCOUNT-ID>>:role/TestMediaConvertRole",
    "settings": {
        "adAvailOffset": 0,
        "inputs": [
            {
                "audioSelectors": {
                    "Audio Selector 1": {
                        "defaultSelection": "NOT_DEFAULT",
                        "offset": 0,
                        "programSelection": 1,
                        "selectorType": "TRACK",
                        "tracks": [
                            1
                        ]
                    }
                },
                "deblockFilter": "DISABLED",
                "denoiseFilter": "DISABLED",
                "fileInput": "s3://<<BUCKET-NAME>>/720.mov",
                "filterEnable": "AUTO",
                "filterStrength": 0,
                "psiControl": "USE_PSI",
                "timecodeSource": "EMBEDDED",
                "videoSelector": {
                    "colorSpace": "FOLLOW",
                    "rotate": "AUTO"
                }
            }
        ],
        "outputGroups": [
            {
                "name": "File Group",
                "outputGroupSettings": {
                    "fileGroupSettings": {
                        "destination": "s3://<<BUCKET-NAME>>/720-converted-06-03-2025.mp4"
                    },
                    "type": "FILE_GROUP_SETTINGS"
                },
                "outputs": [
                    {
                        "audioDescriptions": [
                            {
                                "audioSourceName": "Audio Selector 1",
                                "codecSettings": {
                                    "aacSettings": {
                                        "audioDescriptionBroadcasterMix": "NORMAL",
                                        "bitrate": 64000,
                                        "codecProfile": "LC",
                                        "codingMode": "CODING_MODE_2_0",
                                        "rateControlMode": "CBR",
                                        "rawFormat": "NONE",
                                        "sampleRate": 48000,
                                        "specification": "MPEG4"
                                    },
                                    "codec": "AAC"
                                },
                                "languageCodeControl": "FOLLOW_INPUT"
                            }
                        ],
                        "containerSettings": {
                            "container": "MP4",
                            "mp4Settings": {
                                "cslgAtom": "INCLUDE",
                                "freeSpaceBox": "EXCLUDE",
                                "moovPlacement": "PROGRESSIVE_DOWNLOAD"
                            }
                        },
                        "nameModifier": "_1",
                        "videoDescription": {
                            "afdSignaling": "NONE",
                            "antiAlias": "ENABLED",
                            "codecSettings": {
                                "codec": "H_264",
                                "h264Settings": {
                                    "adaptiveQuantization": "HIGH",
                                    "bitrate": 5000000,
                                    "codecLevel": "AUTO",
                                    "codecProfile": "MAIN",
                                    "entropyEncoding": "CABAC",
                                    "fieldEncoding": "PAFF",
                                    "flickerAdaptiveQuantization": "DISABLED",
                                    "framerateControl": "SPECIFIED",
                                    "framerateConversionAlgorithm": "DUPLICATE_DROP",
                                    "framerateDenominator": 1,
                                    "framerateNumerator": 30,
                                    "gopBReference": "DISABLED",
                                    "gopClosedCadence": 1,
                                    "gopSize": 90.0,
                                    "gopSizeUnits": "FRAMES",
                                    "interlaceMode": "PROGRESSIVE",
                                    "minIInterval": 0,
                                    "numberBFramesBetweenReferenceFrames": 2,
                                    "numberReferenceFrames": 3,
                                    "parControl": "SPECIFIED",
                                    "parDenominator": 1,
                                    "parNumerator": 1,
                                    "qualityTuningLevel": "SINGLE_PASS",
                                    "rateControlMode": "CBR",
                                    "repeatPps": "DISABLED",
                                    "sceneChangeDetect": "ENABLED",
                                    "slices": 1,
                                    "slowPal": "DISABLED",
                                    "softness": 0,
                                    "spatialAdaptiveQuantization": "ENABLED",
                                    "syntax": "DEFAULT",
                                    "telecine": "NONE",
                                    "temporalAdaptiveQuantization": "ENABLED",
                                    "unregisteredSeiTimecode": "DISABLED"
                                }
                            },
                            "colorMetadata": "INSERT",
                            "dropFrameTimecode": "ENABLED",
                            "respondToAfd": "NONE",
                            "scalingBehavior": "DEFAULT",
                            "sharpness": 50,
                            "timecodeInsertion": "DISABLED"
                        }
                    }
                ]
            }
        ],
        "timecodeConfig": {
            "source": "EMBEDDED"
        }
    },
    "userMetadata": {
        "Customer": "Amazon"
    }
}

Notice:

                "videoSelector": {
                    "colorSpace": "FOLLOW",
                    "rotate": "AUTO"
                }

From AWS Console, clicking on View JSON option for the job shows Rotate setting:
Image

@MondQ Good afternoon. This doesn't appear to be SDK issue. SDK is creating job with proper rotate setting in input JSON. This setting is retained when viewed from AWS Console. If you refer service API documentation for InputRotate, it states that 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. By default, the service does no rotation, even if your input video has rotation metadata. The service doesn't pass through rotation metadata.. Hence, this explains the behavior that you are noticing for your use case.

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 This is a minor priority issue and removed needs-reproduction This issue needs reproduction. p2 This is a standard priority issue labels Mar 6, 2025
@MondQ
Copy link
Author

MondQ commented Mar 7, 2025

I can confirm that everything works as expected and this was user error. I accidentally overwrote the video selector containing the rotate instruction.

Thank you for your time.

@MondQ MondQ closed this as completed Mar 7, 2025
Copy link

github-actions bot commented Mar 7, 2025

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. module/sdk-generated p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants