Skip to content

Commit 9d84eae

Browse files
authored
Merge pull request #3360 from cudawarped:nvcuvenc
Fix cudacodec::VideoWriter
2 parents 11b056b + ea1fe97 commit 9d84eae

File tree

13 files changed

+2277
-1121
lines changed

13 files changed

+2277
-1121
lines changed

modules/cudacodec/CMakeLists.txt

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,33 @@ set(the_description "CUDA-accelerated Video Encoding/Decoding")
66

77
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 /wd4324 /wd4512 -Wundef -Wshadow)
88

9-
ocv_add_module(cudacodec opencv_core opencv_videoio opencv_cudaarithm opencv_cudawarping OPTIONAL opencv_cudev WRAP python)
9+
set(required_dependencies opencv_core opencv_videoio opencv_cudaarithm opencv_cudawarping)
10+
if(HAVE_NVCUVENC)
11+
list(APPEND required_dependencies opencv_cudaimgproc)
12+
endif()
13+
14+
ocv_add_module(cudacodec ${required_dependencies} OPTIONAL opencv_cudev WRAP python)
1015

1116
ocv_module_include_directories()
1217
ocv_glob_module_sources()
1318

1419
set(extra_libs "")
1520

16-
if(HAVE_NVCUVID)
17-
list(APPEND extra_libs ${CUDA_CUDA_LIBRARY} ${CUDA_nvcuvid_LIBRARY})
18-
endif()
19-
20-
if(HAVE_NVCUVENC)
21-
if(WIN32)
22-
list(APPEND extra_libs ${CUDA_nvcuvenc_LIBRARY})
21+
if(HAVE_NVCUVID OR HAVE_NVCUVENC)
22+
list(APPEND extra_libs ${CUDA_CUDA_LIBRARY})
23+
if(HAVE_NVCUVID)
24+
list(APPEND extra_libs ${CUDA_nvcuvid_LIBRARY})
25+
endif()
26+
if(HAVE_NVCUVENC)
27+
if(WIN32)
28+
list(APPEND extra_libs ${CUDA_nvencodeapi_LIBRARY})
29+
else()
30+
list(APPEND extra_libs ${CUDA_nvidia-encode_LIBRARY})
31+
endif()
2332
endif()
2433
endif()
2534

2635
ocv_create_module(${extra_libs})
2736

2837
ocv_add_accuracy_tests()
29-
ocv_add_perf_tests()
38+
ocv_add_perf_tests()

0 commit comments

Comments
 (0)