简体   繁体   English

MediaConvert 去除黑条

[英]MediaConvert remove black bars

I'm trying to migrate from AWS ElasticTranscodder to MediaConvert.我正在尝试从 AWS ElasticTranscoder 迁移到 MediaConvert。 One thing that worked for ET is that output had maximum width and height, but for MC those values are fixed and you end up with blackbars if video does not exactly match aspect.对 ET 有用的一件事是输出具有最大宽度和高度,但对于 MC,这些值是固定的,如果视频与纵横比不完全匹配,最终会出现黑条。 Is it possible to crop the output to remove those black bars>是否可以裁剪输出以删除那些黑条>

Thanks for your post.谢谢你的帖子。 Yes you can remove the black bars in the MediaConvert output which normally appear when the input dimensions or aspect ratio are different from the intended output dimensions or aspect ratio.是的,您可以删除 MediaConvert 输出中的黑条,这些黑条通常在输入尺寸或纵横比与预期输出尺寸或纵横比不同时出现。

There are four parameters which can be tuned:有四个参数可以调整:

[a] input dimension cropping (optional) - adjust this if you wish to use a sub-region of the original source picture. [a] 输入尺寸裁剪(可选) - 如果您希望使用原始源图片的子区域,请调整此项。 Useful when the original source has vertical bars on the sides, and you only want the video content from the center of the image.当原始源的侧面有垂直条并且您只想要图像中心的视频内容时很有用。

[b] Output dimensions (resolution & Aspect Ratio) -- if the Aspect Ratio ( Horiz. size ÷ Vertical size ) specified for output does not match the AR of the input (for example, converting a 16x9 asset to a 16x10 output), then pillar-box or letter-box bars are inserted by default in order to preserve the H/V proportions of the original content (meaning, the content is not "stretched".) Note: all dimensions must be multiples of 2. [b] 输出尺寸(分辨率和纵横比)- 如果为输出指定的纵横比(水平尺寸 ÷ 垂直尺寸)与输入的 AR 不匹配(例如,将 16x9 资源转换为 16x10 输出),然后默认插入邮筒或信箱条,以保留原始内容的 H/V 比例(意思是内容没有“拉伸”。)注意:所有尺寸必须是 2 的倍数。

[c] Scaling Behavior -- default is to scale proportionally (see above); [c] 缩放行为——默认是按比例缩放(见上文); the alternative is "stretch to output" which stretches the output non-proportionally to the specified H+V output resolution.另一种方法是“拉伸到输出”,它将输出不成比例地拉伸到指定的 H+V 输出分辨率。 If the AR change is small, the stretching may not be noticeable.如果 AR 变化很小,则拉伸可能不明显。 Further testing suggested.建议进一步测试。

[d] Output position rectangle -- this setting defines how much of the output canvas should be covered with the transcoded content. [d] 输出位置矩形——这个设置定义了输出画布的多少应该被转码的内容覆盖。 It defaults to covering the entire output canvas as defined in step B. Specify other offsets or dimensions here to position or crop the transcoded output.它默认覆盖步骤 B 中定义的整个输出画布。在此处指定其他偏移量或尺寸以定位或裁剪转码输出。

Workflow tips:工作流程提示:

If you want the aspect ratio of the original content to be maintained with no black borders, you will need to calculate the original AR and use it to determine the new scaled-up dimensions.如果您希望原始内容的纵横比保持没有黑色边框,则需要计算原始 AR 并使用它来确定新的放大尺寸。 If this math is done correctly then there should be no black bars on the output.如果这个数学运算正确,那么输出上应该没有黑条。

Some MediaConvert customers do this math using an AWS Lambda function which customizes the MediaConvert job settings before submitting the job.一些 MediaConvert 客户使用 AWS Lambda 函数进行此数学运算,该函数在提交作业之前自定义 MediaConvert 作业设置。 The Lambda function can be triggered automatically using S3 File events (ie, new file arrival).可以使用 S3 文件事件(即新文件到达)自动触发 Lambda 函数。 The Lambda function can leverage media file utilities such as ffmpeg or mediainfo to determine the resolution and other metadata from the source file. Lambda 函数可以利用媒体文件实用程序(例如 ffmpeg 或 mediainfo)来确定源文件的分辨率和其他元数据。 The metadata can then be used to calculate settings for the MediaConvert job.然后可以使用元数据来计算 MediaConvert 作业的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM