0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AWS】MediaConvertのCOMPLETEイベントにinput情報がない

Posted at

ElasticTranscoderが2025/11/13にEOLを迎える
MediaConvertへの移行をしていて、イベントでつまづいたので備忘録
https://aws.amazon.com/jp/blogs/media/support-for-amazon-elastic-transcoder-ending-soon/

After careful consideration, AWS has made the decision to discontinue Amazon Elastic Transcoder, effective November 13, 2025. If you are an active customer of Elastic Transcoder, you can use Elastic Transcoder as normal until November 13, 2025, when support for the service will end. After this date, you will no longer be able to use Elastic Transcoder or any of the capabilities provided by this service.

eventの中身の違い

どうも、Elasticではいつでもeventに全ての情報があったが、MediaConvertではjob作成時と完了時でイベントの構成が違うらしい

ElasticTranscoderのjob完了時イベント

{
   "state" : "PROGRESSING|COMPLETED|WARNING|ERROR",
   "errorCode" : "the code of any error that occurred",
   "messageDetails" : "the notification message you created in Amazon SNS",
   "version" : "API version that you used to create the job",
   "jobId" : "value of Job:Id object that Elastic Transcoder 
             returns in the response to a Create Job request",
   "pipelineId" : "value of PipelineId object 
                  in the Create Job request",
   "input" : {
      job Input settings
   },
   "outputKeyPrefix" : "prefix for file names in Amazon S3 bucket",
   "outputs": [
      {
         applicable job Outputs settings,
         "status" : "Progressing|Complete|Warning|Error"
      },
      {...}
   ],
   "playlists": [
      {
         applicable job playlists settings
      }
   ],
   "userMetadata": {
      "metadata key": "metadata value"
   }
}

MediaConvertのjob完了時イベント

{
    "version": "0",
    "id": "1234abcd-12ab-34cd-56ef-1234567890ab",
    "detail-type": "MediaConvert Job State Change",
    "source": "aws.mediaconvert",
    "account": "111122223333",
    "time": "2022-12-19T19:07:12Z",
    "region": "us-west-2",
    "resources": [
        "arn:aws:mediaconvert:us-west-2::jobs/1671476818694-phptj0"
    ],
    "detail": {
        "timestamp": 1671476832124,
        "accountId": "111122223333",
        "queue": "arn:aws:mediaconvert:us-west-2:111122223333:queues/Default",
        "jobId": "1671476818694-phptj0",
        "status": "COMPLETE",
        "userMetadata": {},
        "warnings": [
            {
                "code": 000000,
                "count": 1
            }
        ],
        "outputGroupDetails": [
            {
                "outputDetails": [
                    {
                        "outputFilePaths": [
                            "s3://amzn-s3-demo-bucket/file/file.mp4"
                        ],
                        "durationInMs": 30041,
                        "videoDetails": {
                            "widthInPx": 1920,
                            "heightInPx": 1080,
                            "qvbrAvgQuality": 7.38,
                            "qvbrMinQuality": 7,
                            "qvbrMaxQuality": 8,
                            "qvbrMinQualityLocation": 2168,
                            "qvbrMaxQualityLocation": 25025
                        }
                    }
                ],
                "type": "FILE_GROUP"
            }
        ],
        "paddingInserted": 0,
        "blackVideoDetected": 10,
        "blackSegments": [
            {
                "start": 0,
                "end": 10
            }
        ]
    }
}

ちなみにjob作成時のイベントの中身が以下

{
    "version": "0",
    "id": "1234abcd-12ab-34cd-56ef-1234567890ab",
    "detail-type": "MediaConvert Job State Change",
    "source": "aws.mediaconvert",
    "account": "111122223333",
    "time": "2022-12-19T19:07:12Z",
    "region": "us-west-2",
    "resources": [
        "arn:aws:mediaconvert:us-west-2:111122223333:jobs/1671476818694-phptj0"
    ],
    "detail": {
        "timestamp": 1671476832075,
        "accountId": "111122223333",
        "queue": "arn:aws:mediaconvert:us-west-2:111122223333:queues/Default",
        "jobId": "1671476818694-phptj0",
        "status": "INPUT_INFORMATION",
        "userMetadata": {},
        "inputDetails": [
            {
                "id": 1,
                "uri": "s3://amzn-s3-demo-bucket/file/file.mp4",
                "audio": [
                    {
                        "channels": 2,
                        "codec": "AAC",
                        "language": "UND",
                        "sampleRate": 44100,
                        "streamId": 2
                    }
                ],
                "video": [
                    {
                        "bitDepth": 8,
                        "codec": "H_264",
                        "colorFormat": "YUV_420",
                        "fourCC": "avc1",
                        "frameRate": 24,
                        "height": 1080,
                        "interlaceMode": "PROGRESSIVE",
                        "sar": "1:1",
                        "standard": "UNSPECIFIED",
                        "streamId": 1,
                        "width": 1920
                    }
                ]
            }
        ]
    }
}

input情報がほしい

後続処理のLambdaで、イベント情報から取得したinputファイルを処理させていたので、それをなんとかしたい
必要なのはinputのkeyだけだったので、MediaConvertでのjob作成時に、UserMetadataに追加することで対応した

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?