Handbrake 如何计算“1080p30”预设中的宽度

Handbrake 如何计算“1080p30”预设中的宽度

我有一个视频:

解决:1920*1080

帕尔:65536/65536

回转:90°

Fast 1080p30预设中,变形选项的默认值是Automatic和模块2

我很好奇的是输出 宽度。高度保持1080应有的高度。但是如何/为什么变化width10801080*1080)并输出视频沒有拉長?

ffmpeg 命令是什么或者计算公式?


下载_输入 - 9 MB

下载_输出 - 2 MB

输入:

General
Complete name               : C:\Users\PN\Desktop\input.mp4
Format                      : MPEG-4
Format profile              : Base Media / Version 2
Codec ID                    : mp42 (isom/mp42)
File size                   : 9.82 MiB
Duration                    : 4 s 305 ms
Overall bit rate mode       : Variable
Overall bit rate            : 19.1 Mb/s
Encoded date                : UTC 2018-12-13 07:28:30
Tagged date                 : UTC 2018-12-13 07:28:30
com.android.version         : 7.0

Video
ID                          : 1
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : Baseline@L4
Format settings             : 1 Ref Frames
Format settings, CABAC      : No
Format settings, ReFrames   : 1 frame
Format settings, GOP        : M=1, N=31
Codec ID                    : avc1
Codec ID/Info               : Advanced Video Coding
Duration                    : 4 s 305 ms
Source duration             : 4 s 314 ms
Bit rate mode               : Variable
Bit rate                    : 17.4 Mb/s
Maximum bit rate            : 17.0 Mb/s
Width                       : 1 920 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 16:9
Rotation                    : 90°
Frame rate mode             : Variable
Frame rate                  : 30.134 FPS
Minimum frame rate          : 24.311 FPS
Maximum frame rate          : 39.630 FPS
Original frame rate         : 30.000 FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.279
Stream size                 : 8.95 MiB (91%)
Source stream size          : 8.95 MiB (91%)
Title                       : VideoHandle
Language                    : English
Encoded date                : UTC 2018-12-13 07:28:30
Tagged date                 : UTC 2018-12-13 07:28:30
mdhd_Duration               : 4305

Audio
ID                          : 2
Format                      : AAC
Format/Info                 : Advanced Audio Codec
Format profile              : LC
Codec ID                    : mp4a-40-2
Duration                    : 4 s 224 ms
Bit rate mode               : Constant
Bit rate                    : 192 kb/s
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 48.0 kHz
Frame rate                  : 46.875 FPS (1024 SPF)
Compression mode            : Lossy
Stream size                 : 99.3 KiB (1%)
Title                       : SoundHandle
Language                    : English
Encoded date                : UTC 2018-12-13 07:28:30
Tagged date                 : UTC 2018-12-13 07:28:30

输出:

General
Complete name               : C:\Users\PN\Desktop\output.mp4
Format                      : MPEG-4
Format profile              : Base Media / Version 2
Codec ID                    : mp42 (isom/iso2/avc1/mp41)
File size                   : 2.40 MiB
Duration                    : 4 s 334 ms
Overall bit rate mode       : Variable
Overall bit rate            : 4 640 kb/s
Encoded date                : UTC 2018-12-16 02:45:36
Tagged date                 : UTC 2018-12-16 02:45:36
Writing application         : HandBrake 1.1.2 2018090500

Video
ID                          : 1
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : Main@L4
Format settings             : CABAC / 4 Ref Frames
Format settings, CABAC      : Yes
Format settings, ReFrames   : 4 frames
Codec ID                    : avc1
Codec ID/Info               : Advanced Video Coding
Duration                    : 4 s 334 ms
Bit rate                    : 4 467 kb/s
Width                       : 1 080 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 0.563
Frame rate mode             : Constant
Frame rate                  : 30.000 FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.128
Stream size                 : 2.31 MiB (96%)
Writing library             : x264 core 155 r2901 7d0ff22
Encoding settings           : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=25000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date                : UTC 2018-12-16 02:45:36
Tagged date                 : UTC 2018-12-16 02:45:36
Color range                 : Limited
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709

Audio
ID                          : 2
Format                      : AAC
Format/Info                 : Advanced Audio Codec
Format profile              : LC
Codec ID                    : mp4a-40-2
Duration                    : 4 s 246 ms
Bit rate mode               : Variable
Bit rate                    : 167 kb/s
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 48.0 kHz
Frame rate                  : 46.875 FPS (1024 SPF)
Compression mode            : Lossy
Stream size                 : 86.7 KiB (4%)
Title                       : Stereo / Stereo
Language                    : English
Default                     : Yes
Alternate group             : 1
Encoded date                : UTC 2018-12-16 02:45:36
Tagged date                 : UTC 2018-12-16 02:45:36

答案1

但是宽度如何/为何变为 1080 (1080*1080)

原始视频是 1920⨉1080,但实际上旋转了 90°(纵向模式),因此 Handbrake 将其旋转回来,这意味着高度突然变成 1920。对于 1080p 预设,Handbrake 随后会将图像缩放回 1080 高度。

并且输出视频没有被拉伸?

因为 Handbrake 将显示宽高比 (DAR) 设置为 0.563,如输出所示。这就是变形缩放的作用。

ffmpeg 命令是什么或者计算公式?

1920⨉0.563 ~= 1080,因此水平值被“压缩”以适应 1080,然后在播放时拉伸。您还可以计算 DAR 为 9/16。

如果你想用 ffmpeg 重现这种输出,你只需要使用scalesetdar过滤器,例如

-vf scale=1080:1080,setdar=9:16

但是,从你的问题中无法确定你是否真的想要或需要这个。我建议只使用 DAR 1 对视频进行编码。或者,你可能希望先将视频旋转回横向,然后使用以下命令重置旋转标志:

-metadata:s:v:0 rotate=0

相关内容