diff --git a/CHANGELOG.md b/CHANGELOG.md index 5decf61d83b..9d25a69fe48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Fix Vulkan GPU acceleration for FFmpeg ([pull #1497](https://github.com/bytedeco/javacpp-presets/pull/1497)) * Build FFmpeg with zimg to enable zscale filter ([pull #1481](https://github.com/bytedeco/javacpp-presets/pull/1481)) * Enable PulseAudio support for FFmpeg on Linux ([pull #1472](https://github.com/bytedeco/javacpp-presets/pull/1472)) * Virtualize `btCollisionWorld`, `btOverlapFilterCallback`, `btOverlapCallback` from Bullet Physics SDK ([pull #1475](https://github.com/bytedeco/javacpp-presets/pull/1475)) diff --git a/ffmpeg/cppbuild.sh b/ffmpeg/cppbuild.sh index 9d2e4ae8e18..dbc412e6472 100755 --- a/ffmpeg/cppbuild.sh +++ b/ffmpeg/cppbuild.sh @@ -118,6 +118,7 @@ export PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig/ patch -Np1 -d $LAME < ../../lame.patch patch -Np1 -d $OPENSSL < ../../openssl-android.patch patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg.patch +patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg-vulkan.patch # patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg-flv-support-hevc-opus.patch sedinplace 's/bool bEnableavx512/bool bEnableavx512 = false/g' x265-*/source/common/param.h sedinplace 's/detect512()/false/g' x265-*/source/common/quant.cpp diff --git a/ffmpeg/ffmpeg-vulkan.patch b/ffmpeg/ffmpeg-vulkan.patch new file mode 100644 index 00000000000..f5469bfd52d --- /dev/null +++ b/ffmpeg/ffmpeg-vulkan.patch @@ -0,0 +1,14 @@ +diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c +index 67b9526255..e3c0c4c24a 100644 +--- a/libavutil/vulkan.c ++++ b/libavutil/vulkan.c +@@ -605,6 +605,9 @@ int ff_vk_exec_add_dep_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, + VkImageLayout *layout_dst; + uint32_t *queue_family_dst; + VkAccessFlagBits *access_dst; + ++ if (!f || !f->hw_frames_ctx) ++ return 1; ++ + AVHWFramesContext *hwfc = (AVHWFramesContext *)f->hw_frames_ctx->data; + AVVulkanFramesContext *vkfc = hwfc->hwctx;