请教个问题:
我的mac电脑上有2个版本的ffmpeg,A版本的ffmpeg是使用brew安装的,B版本的是我自己编译的。代码的版本号都是7.0.1。
但是当我使用相同的参数去压缩同一个文件的时候,压缩比差距很大。
A版本的命令:
ffmpeg -i 1390942-uhd_4096_2160_24fps.mp4 -c:v h264_videotoolbox -b:v 12000k 1390942-uhd_4096_2160_24fps_after.mp4 -loglevel debug
B版本的命令:
/Users/hanyongqiang-mac/code/baidu/transcode/third_party/ffmpeg701/ffmpeg_build_macos/mac_arm64/bin/ffmpeg -i 1390942-uhd_4096_2160_24fps.mp4 -c:v h264_videotoolbox -b:v 12000k 1390942-uhd_4096_2160_24fps_after.mp4 -loglevel debug
源文件的大小是78M,A版本ffmpeg压缩后的文件是39.6M,B版本压缩后是112M,这个奇怪的现象有可能是什么原因呢?
考虑是编译选项的问题,但没有看出有可能的原因,希望有经验的专家帮忙鉴定一下:
2个ffmpeg的编译选项:
A:
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.3.9.4)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.100 / 61. 19.100
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
B:
ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.3.9.4)
configuration: --prefix=/Users/mac/code/baidu/transcode/third_party/ffmpeg701/ffmpeg_build_macos/mac_x86_64 --disable-debug --target-os=darwin --arch=x86_64 --cc='clang -arch x86_64' --enable-cross-compile --ranlib=/usr/bin/ranlib --strip=/usr/bin/strip --extra-cflags='-std=c11 -I/Users/mac/code/baidu/transcode/third_party/ffmpeg701/ffmpeg_build_macos/mac_x86_64/include -I/Users/mac/code/baidu/transcode/third_party/ffmpeg701/ffmpeg_build_macos/mac_x86_64/include/fdk-aac' --extra-cxxflags='-std=c++11' --extra-ldflags=-L/Users/mac/code/baidu/transcode/third_party/ffmpeg701/ffmpeg_build_macos/mac_x86_64/lib --extra-libs='-lpthread -lm -lc++' --host-cflags= --host-ldflags= --enable-static --enable-avformat --disable-decoders --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=aac --disable-shared --disable-alsa --disable-doc --disable-openssl --disable-libvpx --disable-libwebp --disable-lzma --disable-bzlib --disable-xlib --disable-libxcb --disable-vaapi --disable-sndio --disable-librtmp --enable-gpl --enable-nonfree --enable-libx264 --enable-encoder=libx264 --enable-libfdk-aac --enable-encoder=h264_videotoolbox --enable-videotoolbox --disable-libmp3lame --disable-asm --disable-zlib --disable-audiotoolbox
libavutil 59. 8.100 / 59. 8.100
libavcodec 61. 3.100 / 61. 3.100
libavformat 61. 1.100 / 61. 1.100
libavdevice 61. 1.100 / 61. 1.100
libavfilter 10. 1.100 / 10. 1.100
libswscale 8. 1.100 / 8. 1.100
libswresample 5. 1.100 / 5. 1.100
libpostproc 58. 1.100 / 58. 1.100