{"id":4897,"date":"2022-04-26T12:06:49","date_gmt":"2022-04-26T12:06:49","guid":{"rendered":"https:\/\/petabytz.com\/?p=4897"},"modified":"2026-02-20T06:44:30","modified_gmt":"2026-02-20T06:44:30","slug":"transcoding-video-files-with-s3-batch-operations","status":"publish","type":"post","link":"https:\/\/petabytz.com\/blogs\/transcoding-video-files-with-s3-batch-operations\/","title":{"rendered":"Transcoding video files with S3 Batch Operations"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"4897\" class=\"elementor elementor-4897\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-36af2f9 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"36af2f9\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;ekit_has_onepagescroll_dot&quot;:&quot;yes&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f3dc58f\" data-id=\"f3dc58f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a2ce9e5 elementor-widget elementor-widget-heading\" data-id=\"a2ce9e5\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-default\">Transcoding video files with S3 Batch Operations<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1bf4291 elementor-widget elementor-widget-text-editor\" data-id=\"1bf4291\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p id=\"dd3d\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Many media companies store their extensive video repositories in S3. Typical practice suggests storing current videos in S3 Standard and archiving older videos into S3 Glacier. Lambda invocations could be triggered on S3 events such as putting a new object into a bucket. S3 Batch Operations provides you with a managed solution to assist with triggering Lambda functions for existing objects and performing other large-scale tasks in S3.<\/p><p id=\"522f\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\"><strong class=\"lx mn\">Create a Lambda transcoding workflow<\/strong><\/p><p id=\"b5ab\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">First, set up the VOD automation workflow using the post linked above. When you reach step 2, creating the Lambda function, return to this post. You must change the Lambda function so it works with S3 Batch Operations. This modification in the Lambda function uses metadata from a new field in the event JSON passed to Lambda and sends a job response back to S3 Batch Operations.<\/p><p id=\"cc04\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">The VOD Automation post uses an S3 trigger in Lambda to point to the bucket ingesting video files. In the Lambda function you create for S3 Batch Operations, do not setup an S3 trigger as your S3 Batch Operations job will trigger the Lambda function directly.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-65c9514 elementor-widget elementor-widget-image\" data-id=\"65c9514\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" data-src=\"https:\/\/petabytz.com\/wp-content\/uploads\/2022\/04\/1_OKwFJA-o0SUBkH-LnzK9g.png\" title=\"\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fdd3291 elementor-widget elementor-widget-text-editor\" data-id=\"fdd3291\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-selectable-paragraph=\"\">In the convert.py file, add the following lines of code at the beginning to extract the S3 Batch Operations event ID and specific task information, such as S3Bucket and S3Key.<\/p><p data-selectable-paragraph=\"\">First, the S3 Batch Operations job will send job parameters to Lambda in the event JSON, which includes\u00a0<strong class=\"lx mn\">jobId<\/strong>,\u00a0<strong class=\"lx mn\">invocationId<\/strong>, and\u00a0<strong class=\"lx mn\">invocationSchemaVersion<\/strong>. Lambda grabs these parameters by adding the following three lines<\/p><p id=\"61d5\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Python<\/p><p id=\"1438\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">jobId = event[\u2018job\u2019][\u2018id\u2019]<\/p><p id=\"81b1\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">invocationId = event[\u2018invocationId\u2019] invocationSchemaVersion = event[\u2018invocationSchemaVersion\u2019]<\/p><p id=\"045c\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">With the specific S3 bucket and key information now in the event JSON task dictionary, a few more lines extract this information directly in the event records. Add the following lines:<\/p><p id=\"8c30\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Python<\/p><p class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">task = event[\u2018tasks\u2019][0]<\/p><p id=\"f2e4\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">taskId = task[\u2018taskId\u2019]<\/p><p id=\"eaa3\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">sourceS3BucketArn = task[\u2018S3BucketArn\u2019]<\/p><p id=\"03c4\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">sourceS3Key = task[\u2018S3Key\u2019]<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6aab118 elementor-widget elementor-widget-image\" data-id=\"6aab118\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" data-src=\"https:\/\/petabytz.com\/wp-content\/uploads\/2022\/04\/1_k6dXAYuMTeoIEsQaKj82Eg.png\" title=\"\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2eed6e4 elementor-widget elementor-widget-text-editor\" data-id=\"2eed6e4\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-selectable-paragraph=\"\">Each invocation of Lambda from S3 Batch Operations also needs a results dictionary to include\u00a0<strong class=\"lx mn\">taskId<\/strong>,\u00a0<strong class=\"lx mn\">resultCode<\/strong>, and\u00a0<strong class=\"lx mn\">resultString<\/strong>. I set\u00a0<strong class=\"lx mn\">resultCode\u00a0<\/strong>and\u00a0<strong class=\"lx mn\">resultString\u00a0<\/strong>depending on the response from the AWS Elemental MediaConvert jobs. For example, if there is an exception when submitting the MediaConvert jobs, then\u00a0<strong class=\"lx mn\">resultCode\u00a0<\/strong>= 500 and\u00a0<strong class=\"lx mn\">resultString\u00a0<\/strong>= e for the exception string. Then at the end of the MediaConvert job, I\u2019ve added the following code block to add results to the results array:<\/p><p id=\"86c1\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Python<\/p><p id=\"826e\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">finally:<\/p><p id=\"2d1d\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">results.append({<\/p><p id=\"c10a\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">\u2018taskId\u2019: taskId,<\/p><p id=\"62d3\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">\u2018resultCode\u2019: resultCode,<\/p><p id=\"3a62\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">\u2018resultString\u2019:<\/p><p id=\"735d\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">resultString,<\/p><p id=\"9145\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">})<\/p><p id=\"ea7b\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">When triggering Lambda with S3 Batch Operations, a new response needs to be created that returns special data fields. This tells S3 Batch Operations if the Lambda function successfully executed each task. In this specific case, Lambda returns whether or not the MediaConvert job was successfully submitted:<\/p><p id=\"d350\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Python<\/p><p id=\"5821\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">return {<\/p><p id=\"c8a5\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">\u2018invocationSchemaVersion\u2019: invocationSchemaVersion,<\/p><p id=\"edab\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">\u2018treatMissingKeyAs\u2019: \u2018Permenant Failure\u2019,<\/p><p id=\"42d7\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">\u2018invocationId\u2019: invocationId,<\/p><p id=\"32f2\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">\u2018results\u2019: results<\/p><p id=\"d66a\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">}<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3b3bab2 elementor-widget elementor-widget-image\" data-id=\"3b3bab2\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" data-src=\"https:\/\/petabytz.com\/wp-content\/uploads\/2022\/04\/1_wTH_IWkJq6AZhtoTWvDoXw.png\" title=\"\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3026ee3 elementor-widget elementor-widget-text-editor\" data-id=\"3026ee3\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2 id=\"324b\" class=\"nk nl ct ba az dw nm nn no np nq nr ns nt nu nv nw\">Create an S3 Batch Operations job using the console<\/h2><p id=\"b5f8\" class=\"lv lw ct ba lx b ly nx ma ny mc nz me oa mg ob mi\" data-selectable-paragraph=\"\">In the S3 console and choose Buckets,\u00a0<strong class=\"lx mn\">Batch Operations\u00a0<\/strong>on the left tab under Buckets.<\/p><p id=\"4a87\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Choose\u00a0<strong class=\"lx mn\">Create Job<\/strong>.<\/p><p id=\"1507\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Choose the appropriate Region for your S3 bucket. Under\u00a0<strong class=\"lx mn\">Choose manifest<\/strong>, select where your objects are stored and the\u00a0<strong class=\"lx mn\">CSV\u00a0<\/strong>file and enter the path to your S3 bucket. If your manifest contains version IDs, make sure to check that box, and choose\u00a0<strong class=\"lx mn\">Next<\/strong>.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d22be1f elementor-widget elementor-widget-image\" data-id=\"d22be1f\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" data-src=\"https:\/\/petabytz.com\/wp-content\/uploads\/2022\/04\/1_G2V9_YHsdwceTaRpuN-uiw.png\" title=\"\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7e073c5 elementor-widget elementor-widget-text-editor\" data-id=\"7e073c5\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p id=\"2347\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Select\u00a0<strong class=\"lx mn\">Invoke AWS Lambda function<\/strong>, and select the Lambda function you created \u2014 in this case\u00a0<strong class=\"lx mn\">VODLambdaConvertBatch<\/strong>. Select the function version if you need a different version from $LATEST.<\/p><p id=\"43c3\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Choose\u00a0<strong class=\"lx mn\">Next<\/strong>.<\/p><p id=\"7efd\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">In Step 3 of the setup wizard, give your job a description and priority level, and choose a report type and destination.<\/p><p id=\"cc2e\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Choose an IAM role for your S3 Batch Operations job to assume. To learn more about the necessary role and invoking Lambda functions in S3, Select a role with permissions to s3:GetObject and s3:GetObjectVersion for the object source buckets as well as the bucket that holds the manifest file.<\/p><p id=\"9f7e\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">The role also needs s3:PutObject for the destination bucket for the job completion report.<\/p><p id=\"a576\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Lastly, the role needs the lambda:InvokeFunction permission for the Lambda function that it invokes. In this case, the role name is S3BatchLambdaRole.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-61f3a30 elementor-widget elementor-widget-image\" data-id=\"61f3a30\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" data-src=\"https:\/\/petabytz.com\/wp-content\/uploads\/2022\/04\/1_w19YVrqs_NvaZWrH_XqQXA.png\" title=\"\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7a3ee98 elementor-widget elementor-widget-text-editor\" data-id=\"7a3ee98\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;ekit_we_effect_on&quot;:&quot;none&quot;}\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p data-selectable-paragraph=\"\">Choose\u00a0<strong class=\"lx mn\">Next<\/strong>.<\/p><p id=\"7698\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">In Step 4, review and verify your job parameters before choosing\u00a0<strong class=\"lx mn\">Create Job.<\/strong><\/p><p id=\"84e1\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">After S3 finishes reading your job\u2019s manifest, it moves the job to the\u00a0<strong class=\"lx mn\">Awaiting your confirmation\u00a0<\/strong>From here, you can check the number of objects in the manifest and choose\u00a0<strong class=\"lx mn\">Confirm the job\u00a0<\/strong>to run it.<\/p><p id=\"db2c\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">After the job starts running, you can check its object-level progress through the console dashboard view or by selecting the specific job. As each Lambda invocation occurs, S3 writes logs to CloudWatch Logs.<\/p><p id=\"93af\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">In the Lambda console, select your Lambda function, and choose Monitoring. You can see Lambda Invoke metrics along with an easy navigation button to View logs in CloudWatch.<\/p><p id=\"6c67\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">When the S3 Batch Operations job completes, view the Successful and Failed object counts to confirm that everything performed as expected. For the details on failed objects, see your job report.<\/p><p id=\"99f6\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">To monitor video transcode jobs, navigate to the MediaConvert service to monitor transcoding jobs for each of the files.<\/p><h2 id=\"8782\" class=\"nk nl ct ba az dw nm nn no np nq nr ns nt nu nv nw\">Changes for S3 Glacier Restore<\/h2><p id=\"7c39\" class=\"lv lw ct ba lx b ly nx ma ny mc nz me oa mg ob mi\" data-selectable-paragraph=\"\">When creating your Lambda function using the VOD Automation workflow, configure an S3 trigger on the S3 bucket that receives your restored videos. For the event type, choose\u00a0<strong class=\"lx mn\">Restore from Glacier Completed<\/strong>. Create a separate Lambda function for triggering with S3, as the function that you created earlier needed specific additions for S3 Batch Operations reporting.<\/p><p id=\"e6e3\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Create the S3 Batch Operations job as before, with the following changes:<\/p><p id=\"0017\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">In step 2, instead of selecting\u00a0<strong class=\"lx mn\">Invoke AWS Lambda function<\/strong>, select\u00a0<strong class=\"lx mn\">Restore.<\/strong><\/p><p id=\"46b5\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Under\u00a0<strong class=\"lx mn\">Restore options<\/strong>, select the number of days that the restored objects should remain available. The original objects remain in S3 Glacier. After the selected number of days, S3 removes the restored object, leaving only the S3 Glacier copy. For a transcoding job, you only have to restore objects long enough to complete the transcode job, at which point you or S3 can remove the restored object.<\/p><p id=\"3aa7\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Select the retrieval time required, either\u00a0<strong class=\"lx mn\">Bulk or Standard<\/strong>.Choose\u00a0<strong class=\"lx mn\">Next<\/strong>.<\/p><p id=\"cb29\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">In step 3, use the same options described before, except the IAM role. In the case of an S3 Glacier restore job, the IAM role also needs\u00a0<em class=\"og\">s3:RestoreObject<\/em>permissions for the bucket containing the S3 Glacier object.<\/p><p id=\"1bc1\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Complete the job creation and confirmation steps as before.<\/p><p id=\"b78f\" class=\"lv lw ct ba lx b ly lz ma mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">This new function activates when a client submits an S3 Glacier restore job. Based on the retrieval time selected, S3 restores the objects from S3 Glacier. Each completed object restore function then triggers the VOD automation workflow and completes the transcode jobs in MediaConvert.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Transcoding video files with S3 Batch Operations Many media companies store their extensive video repositories in S3. Typical practice suggests storing current videos in S3 Standard and archiving older videos into S3 Glacier. Lambda invocations could be triggered on S3 events such as putting a new object into a bucket. S3 Batch Operations provides you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25,1],"tags":[],"class_list":["post-4897","post","type-post","status-publish","format-standard","hentry","category-blogs","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/posts\/4897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/comments?post=4897"}],"version-history":[{"count":3,"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/posts\/4897\/revisions"}],"predecessor-version":[{"id":14849,"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/posts\/4897\/revisions\/14849"}],"wp:attachment":[{"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/media?parent=4897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/categories?post=4897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/petabytz.com\/blogs\/wp-json\/wp\/v2\/tags?post=4897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}