我有这个 for 循环来减少视频文件的大小。我对 ffmpeg 和视频编码还很陌生。
for i in *.mp4; do ffmpeg -i "$i" -c:v libx265 -preset medium -crf 39 -c:a aac -b:a 128k -y new-"$i"; done
我的目标是减少一些视频文件的文件大小。(.mp4)
但它需要很长时间才能完成,我正在寻找加快速度的技巧。
以下是供参考的输出:
> x265 [info]: frame threads / pool features : 3 / wpp(17 rows)
> x265 [info]: Coding QT: max CU size, min CU size : 64 / 8 x265 [info]:
> Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra x265
> [info]: ME / range / subpel / merge : hex / 57 / 2 / 3 x265
> [info]: Keyframe min / max / scenecut / bias: 25 / 250 / 40 / 5.00
> x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2 x265
> [info]: b-pyramid / weightp / weightb : 1 / 1 / 0 x265 [info]:
> References / ref-limit cu / depth : 3 / off / on x265 [info]: AQ:
> mode / str / qg-size / cu-tree : 2 / 1.0 / 32 / 1 x265 [info]: Rate
> Control / qCompress : CRF-39.0 / 0.60 x265 [info]: tools:
> rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra x265 [info]:
> tools: strong-intra-smoothing lslices=6 deblock sao Output #0, mp4, to
> 'file.mp4': Metadata:
> major_brand : isom
> minor_version : 512
> compatible_brands: isomiso2avc1mp41
> encoder : Lavf58.29.100
> Stream #0:0(und): Video: hevc (libx265) (hev1 / 0x31766568), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 60 fps, 15360 tbn, 60
> tbc (default)
> Metadata:
> handler_name : VideoHandler
> encoder : Lavc58.54.100 libx265
> Side data:
> cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
> Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
> Metadata:
> handler_name : SoundHandler
> encoder : Lavc58.54.100 aac frame=191017 fps= 33 q=-0.0 size= 163584kB time=00:53:03.71 bitrate= 420.9kbits/s dup=516 drop=0
> speed=0.542x