obs-studio/plugins/obs-ffmpeg/CMakeLists.txt
jp9000 ed0c7bcd6a obs-ffmpeg: Add texture-based NVENC encoder implementation
Adds a texture-based NVENC implementation which passes OBS NV12 output
textures directly to NVENC without downloading them off of the GPU,
increasing NVENC performance by a significant margin.

If NV12 textures are unavailable or the new encoder fails to initialize
for whatever reason, it will fall back to the FFmpeg NVENC
implementation safely.
2019-02-07 17:00:47 -08:00

52 lines
1015 B
CMake

project(obs-ffmpeg)
if(MSVC)
set(obs-ffmpeg_PLATFORM_DEPS
w32-pthreads)
endif()
find_package(FFmpeg REQUIRED
COMPONENTS avcodec avfilter avdevice avutil swscale avformat swresample)
include_directories(${FFMPEG_INCLUDE_DIRS})
set(obs-ffmpeg_HEADERS
obs-ffmpeg-formats.h
obs-ffmpeg-compat.h
closest-pixel-format.h)
set(obs-ffmpeg_SOURCES
obs-ffmpeg.c
obs-ffmpeg-audio-encoders.c
obs-ffmpeg-nvenc.c
obs-ffmpeg-output.c
obs-ffmpeg-mux.c
obs-ffmpeg-source.c)
if(UNIX AND NOT APPLE)
list(APPEND obs-ffmpeg_SOURCES
obs-ffmpeg-vaapi.c)
LIST(APPEND obs-ffmpeg_PLATFORM_DEPS
${LIBVA_LBRARIES})
endif()
if(WIN32)
list(APPEND obs-ffmpeg_SOURCES
jim-nvenc.c
jim-nvenc-helpers.c)
list(APPEND obs-ffmpeg_HEADERS
jim-nvenc.h)
endif()
add_library(obs-ffmpeg MODULE
${obs-ffmpeg_HEADERS}
${obs-ffmpeg_SOURCES})
target_link_libraries(obs-ffmpeg
libobs
media-playback
${obs-ffmpeg_PLATFORM_DEPS}
${FFMPEG_LIBRARIES})
install_obs_plugin_with_data(obs-ffmpeg data)
add_subdirectory(ffmpeg-mux)