nvpro-samples / vk_video_samples

Vulkan video samples
Apache License 2.0
253 stars 41 forks source link

Build Failure #3

Closed kyamant closed 3 years ago

kyamant commented 3 years ago
  1. Link broken [FFMPEG libraries for Windows] Download the following archive: https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2021-04-12-12-38/ffmpeg-N-101934-g7e241a1b73-win64-lgpl-shared.zip Then extract the archive to <APP_INSTALLED_LOC>\bin\libs\ffmpeg and add the path of the <APP_INSTALLED_LOC>\bin\libs\ffmpeg\win64\ of the application. Please make sure that <APP_INSTALLED_LOC>\bin\libs\ffmpeg\win64\bin location contains avformat-58.dll, avutil-56.dll and avcodec-58.dll shared libraries and <APP_INSTALLED_LOC>\bin\libs\ffmpeg\win64\lib contains the corresponding lib files.

  2. build_windows_targets.bat doesn't work:

    
    Determining VS version
    Detected Visual Studio Version as 16 0
    Generating 64-bit CMake files for Visual Studio 16 0
    CMake Error: Could not create named generator Visual Studio 16 0 Win64

Generators

Building 64-bit Debug Microsoft (R) Build Engine version 16.9.0+57a23d249 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist. Switch: ALL_BUILD.vcxproj

64-bit Debug build failed!

3. The instructions don't provide guidance on the environment variables to set:

cmake .. -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_INSTALL_PREFIX="$(pwd)/install/Debug" -DCMAKE_BUILD_TYPE=Debug -- Building for: Visual Studio 16 2019 CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042. -- The C compiler identification is MSVC 19.28.29910.0 -- The CXX compiler identification is MSVC 19.28.29910.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: c:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: c:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: C:/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0/python3.9.exe (found suitable version "3.9.4", minimum required is "3") -- Selected Windows build type: Debug -- Selected Windows build binary arch: wddm2_amd64_debug -- VULKAN_VIDEO_APIS_INCLUDE path is not set. Setting the default path location to D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/include -- LIBNVPARSER_BINARY_ROOT is at D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/bin/libs/nv_vkvideo_parser/wddm2_amd64_debug -- VULKAN_VIDEO_PARSER_INCLUDE path is not set. Setting the default path location to D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/include/nv_vkvideo_parser -- Trying to find Vulkan Video Parser library at D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/bin/libs/nv_vkvideo_parser/wddm2_amd64_debug -- Vulkan Video Parser Lib: D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/bin/libs/nv_vkvideo_parser/wddm2_amd64_debug/nvidia-vkvideo-parser.lib -- FFMPEG lib location D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/bin/libs/ffmpeg/win64/lib -- FFMPEG include location D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/bin/libs/ffmpeg/win64/include -- The location of the Vulkan Video driver source: - encoder test app will not be built -- AVCODEC_LIB-NOTFOUND -- AVFORMAT_LIB-NOTFOUND -- AVUTIL_LIB-NOTFOUND -- TEGRA_TOP nor LINUX_DRIVER_BRANCH_TOP nor WINDOWS_DRIVER_BRANCH_TOP are set Found GLSLANG libraries: D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/external/shaderc/build/install/lib/shaderc_shared.lib;glslang;OGLCompiler;OSDependent;HLSL;SPIRV;SPVRemapper;SPIRV-Tools-opt;SPIRV-Tools -- Building demos with control flow guard -- Configuring done CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: AVCODEC_LIB linked by target "vk-video-dec-test" in directory D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/demos/vk-video-dec AVFORMAT_LIB linked by target "vk-video-dec-test" in directory D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/demos/vk-video-dec AVUTIL_LIB linked by target "vk-video-dec-test" in directory D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/demos/vk-video-dec

-- Generating done CMake Generate step failed. Build files cannot be regenerated correctly.

zlatinski commented 3 years ago

Please follow the instructions from https://github.com/nvpro-samples/vk_video_samples/blob/main/vk_video_decoder/BUILD.md. There is no mention of using build_windows_targets.bat in the build instructions.

kyamant commented 3 years ago

@zlatinski : What about items 1 and 3, those are from the BUILD.md. What to do with NOTFOUND stuff.

zlatinski commented 3 years ago

@zlatinski : What about items 1 and 3, those are from the BUILD.md. What to do with NOTFOUND stuff.

-- AVCODEC_LIB-NOTFOUND -- AVFORMAT_LIB-NOTFOUND -- AVUTIL_LIB-NOTFOUND

This means the FFMPEG libraries are not downloaded and installed at the appropriate locations. Do you have those installed at D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/bin/libs/ffmpeg/win64/lib?

kyamant commented 3 years ago

@zlatinski : What about items 1 and 3, those are from the BUILD.md. What to do with NOTFOUND stuff.

-- AVCODEC_LIB-NOTFOUND -- AVFORMAT_LIB-NOTFOUND -- AVUTIL_LIB-NOTFOUND

This means the FFMPEG libraries are not downloaded and installed at the appropriate locations. Do you have those installed at D:/Personal/~~PRIVATE~~/ProjVulkanVideoSamples/vk_video_decoder/bin/libs/ffmpeg/win64/lib?

Why don't you read the whole text? Item 1 says your ffmpeg link is broken

zlatinski commented 3 years ago

It looks like the publisher of the package has removed this version of the FFMPEG package. Please use this latest version from here https://github.com/BtbN/FFmpeg-Builds/releases. For example:

https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2021-05-07-13-49/ffmpeg-N-102431-gf140239777-win64-lgpl-shared.zip

Jasper-Bekkers commented 3 years ago

Thanks for the new link, would it be possible to update the build instructions with that information?

Later on in the build steps I seem to be running into compilation issues:

c:\Users\Jasper\vk_video_samples\vk_video_decoder\build>    cmake --build . --parallel 16 --config Debug
Microsoft (R) Build Engine version 16.9.0+5e4b48a27 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Generating vk_enum_string_helper.h
  Generating ../../../libs/VkCodecUtils/HelpersDispatchTable.cpp
  Generating ../../../libs/VkCodecUtils/HelpersDispatchTable.h
  Building Custom Rule C:/Users/Jasper/vk_video_samples/vk_video_decoder/demos/vk-video-dec/CMakeLists.txt
  C:\Users\Jasper\vk_video_samples\vk_video_decoder\scripts\threading_generator.py:139: SyntaxWarning: "is not" with a literal. Did you mean "!=
  "?
    if ((elem.tag is not 'type') and (elem.tail is not None)) and '*' in elem.tail:
  C:\Users\Jasper\vk_video_samples\vk_video_decoder\scripts\unique_objects_generator.py:303: SyntaxWarning: "is not" with a literal. Did you mea
  n "!="?
    if ((elem.tag is not 'type') and (elem.tail is not None)) and '*' in elem.tail:
  C:\Users\Jasper\vk_video_samples\vk_video_decoder\scripts\object_tracker_generator.py:500: SyntaxWarning: "is not" with a literal. Did you mea
  n "!="?
    if ((elem.tag is not 'type') and (elem.tail is not None)) and '*' in elem.tail:
  C:\Users\Jasper\vk_video_samples\vk_video_decoder\scripts\helper_file_generator.py:240: SyntaxWarning: "is not" with a literal. Did you mean "
  !="?
    if ((elem.tag is not 'type') and (elem.tail is not None)) and '*' in elem.tail:
  C:\Users\Jasper\vk_video_samples\vk_video_decoder\scripts\mock_icd_generator.py:971: SyntaxWarning: "is not" with a literal. Did you mean "!="
  ?
    if ((elem.tag is not 'type') and (elem.tail is not None)) and '*' in elem.tail:
  Generating vk_safe_struct.h
  Generating vk_safe_struct.cpp
  Generating vk_object_types.h
  Generating vk_layer_dispatch_table.h
  Generating vk_dispatch_table_helper.h
  Generating vk_extension_helper.h
  Generating vk_typemap_helper.h
  Generating spirv_tools_commit_id.h
  Building Custom Rule C:/Users/Jasper/vk_video_samples/vk_video_decoder/CMakeLists.txt
  Building Custom Rule C:/Users/Jasper/vk_video_samples/vk_video_decoder/CMakeLists.txt
  VulkanFrame.cpp
  vk_format_utils.cpp
  VkVideoUtils.vcxproj -> C:\Users\Jasper\vk_video_samples\vk_video_decoder\build\Debug\VkVideoUtils.lib
C:\Users\Jasper\vk_video_samples\vk_video_decoder\libs\NvCodecUtils/FFmpegDemuxer.h(173,9): error C3861: 'av_register_all': identifier not found
 [C:\Users\Jasper\vk_video_samples\vk_video_decoder\build\demos\vk-video-dec\vk-video-dec-test.vcxproj]
C:\Users\Jasper\vk_video_samples\vk_video_decoder\libs\NvCodecUtils/FFmpegDemuxer.h(201,9): error C3861: 'av_register_all': identifier not found
 [C:\Users\Jasper\vk_video_samples\vk_video_decoder\build\demos\vk-video-dec\vk-video-dec-test.vcxproj]
  VulkanVideoProcessor.cpp
C:\Users\Jasper\vk_video_samples\vk_video_decoder\libs\NvCodecUtils/FFmpegDemuxer.h(173,9): error C3861: 'av_register_all': identifier not found
 [C:\Users\Jasper\vk_video_samples\vk_video_decoder\build\demos\vk-video-dec\vk-video-dec-test.vcxproj]
C:\Users\Jasper\vk_video_samples\vk_video_decoder\libs\NvCodecUtils/FFmpegDemuxer.h(201,9): error C3861: 'av_register_all': identifier not found
 [C:\Users\Jasper\vk_video_samples\vk_video_decoder\build\demos\vk-video-dec\vk-video-dec-test.vcxproj]
  Main.cpp
  Shell.cpp
  ShellDirect.cpp
  FrameProcessor.cpp
  NvVkDecoder.cpp
  VulkanVideoFrameBuffer.cpp
  HelpersDispatchTable.cpp
  VulkanShaderCompiler.cpp
  nvVkFormats.cpp
  pattern.cpp
  VulkanVideoUtils.cpp
  VulkanVideoParser.cpp
  ShellWin32.cpp
  Generating Code...

c:\Users\Jasper\vk_video_samples\vk_video_decoder\build>python
Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32

Edit: fixing the python script as suggested by python doesn't seem to make the av_register_all issue disappear.

Edit 2: Looks like FFMPEG 4.0 has removed & deprecated that call, and it can safely be omitted.

kyamant commented 3 years ago

It looks like the publisher of the package has removed this version of the FFMPEG package. Please use this latest version from here https://github.com/BtbN/FFmpeg-Builds/releases. For example:

https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2021-05-07-13-49/ffmpeg-N-102431-gf140239777-win64-lgpl-shared.zip

This still does NOT set the variables required by your installation script: AVCODEC_LIB-NOTFOUND AVFORMAT_LIB-NOTFOUND AVUTIL_LIB-NOTFOUND TEGRA_TOP nor LINUX_DRIVER_BRANCH_TOP nor WINDOWS_DRIVER_BRANCH_TOP are set

zlatinski commented 3 years ago

Please delete your build directory and recreate it with cmake again. I'll update the build instructions with the new location of the library.

zlatinski commented 3 years ago

Updated the instructions on how to find the latest FFMPEG driver for Windows.