原因:恰好下载的是lgpl,ffmpeg缺少依赖项,自身不带libx264编码类型
安装好了ffmpeg后,如果使用ffmpeg命令去把某个视频文件转成h264视频编码、mp3音频编码或者其他ffmpeg自身不带的xxx编码类型,就会看到报错信息,unknown encoder ‘xxx’
使用ffmpeg-master-latest-win64-gpl即可
gpl 包括所有依赖项,甚至那些需要完整 GPL 而不仅仅是 LGPL 的依赖项。 lgpl 缺少仅 GPL 的库。最突出的是 libx264 和 libx265。 gpl-shared 与 gpl 相同,但带有 libav* 系列共享库而不是纯静态可执行文件。 lgpl-shared 再次相同,但具有 lgpl 依赖项集。
转换编码类型为libx265
代码语言:javascript复制ffmpeg -i input.mp4 -c:v libx265 -crf 18 -c:a copy output.mp4
代码语言:javascript复制ffmpeg version N-105919-g546afd0d49-20220313 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (crosstool-NG 1.24.0.533_681aaef)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220313
libavutil 57. 23.100 / 57. 23.100
libavcodec 59. 23.100 / 59. 23.100
libavformat 59. 18.101 / 59. 18.101
libavdevice 59. 5.100 / 59. 5.100
libavfilter 8. 27.100 / 8. 27.100
libswscale 6. 5.100 / 6. 5.100
libswresample 4. 4.100 / 4. 4.100
libpostproc 56. 4.100 / 56. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:02:23.28, start: 0.000000, bitrate: 1816 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 720x1204 [SAR 1:1 DAR 180:301], 1682 kb/s, SAR 32766:32767 DAR 137160:229369, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.5 34-7a5709048
x265 [info]: build info [Windows][GCC 11.2.0][64 bit] 8bit 10bit 12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 2 / wpp(19 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-18.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing lslices=7 deblock sao
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf59.18.101
Stream #0:0(und): Video: hevc (hev1 / 0x31766568), yuv420p(progressive), 720x1204 [SAR 32766:32767 DAR 137160:229369], q=2-31, 25 fps, 12800 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
encoder : Lavc59.23.100 libx265
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
frame= 3582 fps= 27 q=24.8 Lsize= 37709kB time=00:02:23.22 bitrate=2156.9kbits/s speed=1.07x
video:35330kB audio:2257kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.325097%
x265 [info]: frame I: 31, Avg QP:16.60 kb/s: 9236.63
x265 [info]: frame P: 927, Avg QP:17.33 kb/s: 5110.16
x265 [info]: frame B: 2624, Avg QP:23.92 kb/s: 841.92
x265 [info]: Weighted P-Frames: Y:2.3% UV:1.4%
x265 [info]: consecutive B-frames: 10.6% 4.4% 16.1% 38.2% 30.7%
encoded 3582 frames in 134.30s (26.67 fps), 2019.17 kb/s, Avg QP:22.15