From 4d92c71a8b58102bde05ceb4f29b668f321eb487 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 14 Mar 2025 10:05:48 +0000 Subject: [PATCH 1/2] Add libswresample to FFmpeg source build --- packaging/build_ffmpeg.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packaging/build_ffmpeg.sh b/packaging/build_ffmpeg.sh index c5d284371..905b24aa0 100755 --- a/packaging/build_ffmpeg.sh +++ b/packaging/build_ffmpeg.sh @@ -61,7 +61,8 @@ tar -xf ffmpeg.tar.gz --strip-components 1 --enable-avfilter \ --enable-avformat \ --enable-avutil \ - --enable-swscale + --enable-swscale \ + --enable-swresample make -j install ls ${prefix}/* @@ -78,6 +79,7 @@ if [[ "$(uname)" == Darwin ]]; then avdevice=libavdevice.58 avfilter=libavfilter.7 swscale=libswscale.5 + swresample=libswresample.2 elif [[ ${major_ver} == 5 ]]; then avutil=libavutil.57 avcodec=libavcodec.59 @@ -85,6 +87,7 @@ if [[ "$(uname)" == Darwin ]]; then avdevice=libavdevice.59 avfilter=libavfilter.8 swscale=libswscale.6 + swresample=libswresample.3 elif [[ ${major_ver} == 6 ]]; then avutil=libavutil.58 avcodec=libavcodec.60 @@ -92,6 +95,7 @@ if [[ "$(uname)" == Darwin ]]; then avdevice=libavdevice.60 avfilter=libavfilter.9 swscale=libswscale.7 + swresample=libswresample.4 elif [[ ${major_ver} == 7 ]]; then avutil=libavutil.59 avcodec=libavcodec.61 @@ -99,6 +103,7 @@ if [[ "$(uname)" == Darwin ]]; then avdevice=libavdevice.61 avfilter=libavfilter.10 swscale=libswscale.8 + swresample=libswresample.5 else printf "Error: unexpected FFmpeg major version: %s\n" ${major_ver} exit 1; @@ -120,7 +125,7 @@ if [[ "$(uname)" == Darwin ]]; then fi # list up the paths to fix - for lib in ${avcodec} ${avdevice} ${avfilter} ${avformat} ${avutil} ${swscale}; do + for lib in ${avcodec} ${avdevice} ${avfilter} ${avformat} ${avutil} ${swscale} ${swresample}; do ${otool} -l ${prefix}/lib/${lib}.dylib | grep -B2 ${prefix} done @@ -155,6 +160,13 @@ if [[ "$(uname)" == Darwin ]]; then ${prefix}/lib/${swscale}.dylib ${otool} -l ${prefix}/lib/${swscale}.dylib | grep -B2 ${prefix} + ${install_name_tool} \ + -change ${prefix}/lib/${avutil}.dylib @rpath/${avutil}.dylib \ + -delete_rpath ${prefix}/lib \ + -id @rpath/${swresample}.dylib \ + ${prefix}/lib/${swresample}.dylib + ${otool} -l ${prefix}/lib/${swresample}.dylib | grep -B2 ${prefix} + ${install_name_tool} \ -change ${prefix}/lib/${avcodec}.dylib @rpath/${avcodec}.dylib \ -change ${prefix}/lib/${avutil}.dylib @rpath/${avutil}.dylib \ From 914b2168b8ee709101ad0e131e11fd8390f3d701 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 14 Mar 2025 10:59:00 +0000 Subject: [PATCH 2/2] Fix version numbers --- packaging/build_ffmpeg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/build_ffmpeg.sh b/packaging/build_ffmpeg.sh index 905b24aa0..9fef66814 100755 --- a/packaging/build_ffmpeg.sh +++ b/packaging/build_ffmpeg.sh @@ -79,7 +79,7 @@ if [[ "$(uname)" == Darwin ]]; then avdevice=libavdevice.58 avfilter=libavfilter.7 swscale=libswscale.5 - swresample=libswresample.2 + swresample=libswresample.3 elif [[ ${major_ver} == 5 ]]; then avutil=libavutil.57 avcodec=libavcodec.59 @@ -87,7 +87,7 @@ if [[ "$(uname)" == Darwin ]]; then avdevice=libavdevice.59 avfilter=libavfilter.8 swscale=libswscale.6 - swresample=libswresample.3 + swresample=libswresample.4 elif [[ ${major_ver} == 6 ]]; then avutil=libavutil.58 avcodec=libavcodec.60