我正在解码一个视频从mp2和编码到mp4。
原始文件:
Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9]
结果文件:
Video: mpeg4 (Simple Profile) (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/

10-09 13:30