From 44cdd58d0cc42ee44e46be9fb57809647eb61278 Mon Sep 17 00:00:00 2001 From: lh <2334563547@qq.com> Date: Mon, 21 Sep 2026 16:34:29 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E7=BB=9F=E4=B8=80=20FFmpeg=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E9=85=8D=E7=BD=AE=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重新 配置 FFmpeg 头文件和链接库 - 区分 Debug 与 Release 链接配置 - 移除额外依赖校验和 DLL 自动复制 --- Src4/ffmpeg.pri | 66 +++++++++----------------------- Src4/nmNum/nmSubWxs/nmSubWxs.pro | 1 - 2 files changed, 18 insertions(+), 49 deletions(-) diff --git a/Src4/ffmpeg.pri b/Src4/ffmpeg.pri index 6c9f6156..a8cca994 100644 --- a/Src4/ffmpeg.pri +++ b/Src4/ffmpeg.pri @@ -1,52 +1,22 @@ -# PEBI动画导出使用的可选FFmpeg n1.1开发包。 -# nmSubWxs默认启用;其他目标可通过CONFIG显式选择是否接入。 -contains(CONFIG, nm_ffmpeg_video_export) { - FFMPEG_11_ROOT = $${geoHome}/3rd/FFmpeg-1.1 - FFMPEG_11_VS2010_COMPAT = $${FFMPEG_11_ROOT}/compat/vs2010 - FFMPEG_11_RUNTIME_DLLS = \ - $${FFMPEG_11_ROOT}/bin/avformat-54.dll \ - $${FFMPEG_11_ROOT}/bin/avcodec-54.dll \ - $${FFMPEG_11_ROOT}/bin/avutil-52.dll \ - $${FFMPEG_11_ROOT}/bin/swscale-2.dll +# PEBI animation export FFmpeg n1.1 dependency. +win32{ - !exists($${FFMPEG_11_ROOT}/include/libavformat/avformat.h) { - error(FFmpeg n1.1 headers were not found in $${FFMPEG_11_ROOT}/include) - } - !exists($${FFMPEG_11_ROOT}/include/libavcodec/avcodec.h) { - error(FFmpeg n1.1 avcodec headers were not found) - } - !exists($${FFMPEG_11_ROOT}/include/libavutil/avutil.h) { - error(FFmpeg n1.1 avutil headers were not found) - } - !exists($${FFMPEG_11_ROOT}/include/libswscale/swscale.h) { - error(FFmpeg n1.1 swscale headers were not found) - } - !exists($${FFMPEG_11_ROOT}/lib/avformat.lib) { - error(FFmpeg n1.1 avformat import library was not found) - } - !exists($${FFMPEG_11_ROOT}/lib/avcodec.lib) { - error(FFmpeg n1.1 avcodec import library was not found) - } - !exists($${FFMPEG_11_ROOT}/lib/avutil.lib) { - error(FFmpeg n1.1 avutil import library was not found) - } - !exists($${FFMPEG_11_ROOT}/lib/swscale.lib) { - error(FFmpeg n1.1 swscale import library was not found) - } - !exists($${FFMPEG_11_VS2010_COMPAT}/inttypes.h) { - error(FFmpeg n1.1 VS2010 compatibility header inttypes.h was not found) - } +DEFINES += NM_ENABLE_FFMPEG_VIDEO_EXPORT - DEFINES += NM_ENABLE_FFMPEG_VIDEO_EXPORT - INCLUDEPATH += $${FFMPEG_11_VS2010_COMPAT} - INCLUDEPATH += $${FFMPEG_11_ROOT}/include - LIBS += -L$${FFMPEG_11_ROOT}/lib - LIBS += -lavformat -lavcodec -lavutil -lswscale +INCLUDEPATH += $${geoHome}/3rd/FFmpeg-1.1/compat/vs2010 +INCLUDEPATH += $${geoHome}/3rd/FFmpeg-1.1/include +DEPENDPATH += $${geoHome}/3rd/FFmpeg-1.1/compat/vs2010 +DEPENDPATH += $${geoHome}/3rd/FFmpeg-1.1/include - for(FFMPEG_11_RUNTIME_DLL, FFMPEG_11_RUNTIME_DLLS) { - !exists($${FFMPEG_11_RUNTIME_DLL}) { - error(FFmpeg runtime DLL was not found: $${FFMPEG_11_RUNTIME_DLL}) - } - QMAKE_POST_LINK += $$QMAKE_COPY $$quote($${FFMPEG_11_RUNTIME_DLL}) $$quote($${DESTDIR}) $$escape_expand(\\n\\t) - } +Debug:LIBS += -L$${geoHome}/3rd/FFmpeg-1.1/lib \ +-lavformat \ +-lavcodec \ +-lavutil \ +-lswscale + +Release:LIBS += -L$${geoHome}/3rd/FFmpeg-1.1/lib \ +-lavformat \ +-lavcodec \ +-lavutil \ +-lswscale } diff --git a/Src4/nmNum/nmSubWxs/nmSubWxs.pro b/Src4/nmNum/nmSubWxs/nmSubWxs.pro index 4f90e551..874def2f 100644 --- a/Src4/nmNum/nmSubWxs/nmSubWxs.pro +++ b/Src4/nmNum/nmSubWxs/nmSubWxs.pro @@ -10,7 +10,6 @@ TEMPLATE = lib include(../../setting.pri) include(../../vtk.pri) -CONFIG += nm_ffmpeg_video_export include(../../ffmpeg.pri) DEFINES += NM_SUB_WXS_LIBRARY