如果我有一个由 Premiere Pro 制作的非常大的数 GB 视频文件,包括类似 powerpoint 的幻灯片和音频,我怎样才能使视频变得更小?
在 ffmpeg 或 Premiere Pro 中
该文件确实不应该超过 GB。它只是音频和非常低分辨率的图像。
它只有一两个图像..图像不经常更改。
有一些文本每 5 分钟左右更改一次。
视频时长 3.5 小时。
C:\Users\User\Desktop\pprogenproj>mediainfo GenVideo.mp4
General
Complete name : GenVideo.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/mp41)
File size : 6.76 GiB
Duration : 3 h 30 min
Overall bit rate mode : Variable
Overall bit rate : 4 597 kb/s
Encoded date : UTC 2020-01-01 23:28:03
Tagged date : UTC 2020-01-02 00:15:22
TIM : 00:00:00:00
TSC : 25
TSZ : 1
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 4 frames
Format settings, GOP : M=4, N=25
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 h 30 min
Source duration : 3 h 30 min
Bit rate : 4 403 kb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.191
Stream size : 6.47 GiB (96%)
Source stream size : 6.47 GiB (96%)
Language : English
Encoded date : UTC 2020-01-01 23:28:03
Tagged date : UTC 2020-01-01 23:28:03
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 3 h 30 min
Source duration : 3 h 30 min
Bit rate mode : Variable
Bit rate : 192 kb/s
Maximum bit rate : 276 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 285 MiB (4%)
Source stream size : 285 MiB (4%)
Language : English
Encoded date : UTC 2020-01-01 23:28:03
Tagged date : UTC 2020-01-01 23:28:03
C:\Users\User\Desktop\pprogenproj>
使用ffmpeg对视频和音频进行重新编码,或者以较低的音频比特率和较低的视频配置文件重新录制。
由 barlop 添加
重新编码它,因此 mp4 的默认值 -vcodec libx264 使它变得更小,因为它将其编码为比原始比特率低得多的比特率,因此产生了最大的不同。而且,由于视频主要是幻灯片,我调整了帧率。执行 -r 3 是每秒 3 帧的帧速率。这也大大降低了比特率。
ffmpeg -i input.mp4 -r 3 output.mp4
这与ffmpeg -i input.mp4 -vcodec libx264 -acodec aac -r 3 output.mp4
这个 ffmpeg 是向我建议的,它使视频变得更小。
ffmpeg -i GenVideo.mp4 -pix_fmt yuv420p out.mp4
添加
我会接受 K7AYY 的回答,因为它比我所拥有的有了显着改善
调整帧率 -
ffmpeg -i GenVideo.mp4 -pix_fmt yuv420p -r 3 out2.mp4
重新调整比特率。看起来调整帧速率,-r 3,(每秒 3 帧)会降低比特率..
在做这一行时
ffmpeg -i GenVideo.mp4 -pix_fmt yuv420p out.mp4
,这里-pix_fmt yuv420p
没有区别,因为原始文件已经是那个了。例如,mediainfo 显示它是 YUV 和色度采样 4:2:0,即 yuv420p。ffmpeg -i Genvideo.mp4 显示 yuv420p。应该指定编解码器(-vcodec 和 -acodec)。默认似乎是 -vcodec libx264 -acodec aac。所以,
ffmpeg -i GenVideo.mp4 -vcodec libx264 -acodec aac -r 3 out.mp4
会很好。ffmpeg -i input.mp4 output.mp4
(即 -vcodec libx264 -acodec aac),将比特率从例如 4000kb/s 大幅降低到 171kb/s。(将 7GB 变为 400MB,或 35MB 变为 2MB)。并且加上-r 3,降低到45kb/s,把400MB文件变成240M左右,把2MB变成2.1MB到1.2MB左右。