gpt4 book ai didi

c - FFmpeg - C - 编码视频 - 设置纵横比

转载 作者:太空宇宙 更新时间:2023-11-04 03:54:11 25 4
gpt4 key购买 nike

我正在从 mp2 解码视频并编码为 mp4。

原始文件:

视频:mpeg2video(主)([2][0][0][0]/0x0002),yuv420p,720x576 [SAR 64:45 DAR 16:9]

生成的文件:

视频:mpeg4(简单配置文件)(mp4v/0x7634706D),yuv420p,720x576 [SAR 1:1 DAR 5:4]

如您所见,分辨率没有改变,但宽高比改变了。

我的问题是如何设置这些值(SAR 和/或 DAR)?

最佳答案

要设置输出纵横比,您可以使用“-aspect”选项,参见ffmpeg documentation .

-aspect[:stream_specifier] aspect (output,per-stream)’

Set the video display aspect ratio specified by aspect.

aspect can be a floating point number string, or a string of the form num:den, where num and den are the numerator and denominator of the aspect ratio. For example "4:3", "16:9", "1.3333", and "1.7777" are valid argument values.

If used together with ‘-vcodec copy’, it will affect the aspect ratio stored at container level, but not the aspect ratio stored in encoded frames, if it exists.

关于c - FFmpeg - C - 编码视频 - 设置纵横比,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18376283/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com